fix: Centralize all agent work to their work directories
- Move knowledge base from root to agents/orchestrator/knowledge/ - Move orphaned files (AKM, Event-Plan) to orchestrator/work/ - Update all kb_file paths to new location - Change orchestrator stream to use work_dir instead of root - Now ALL agents (including orchestrator) work in their own folders - No more files created in project root - Consistent work directory behavior across all agents
This commit is contained in:
parent
4c03663418
commit
98ff812a82
12 changed files with 59 additions and 2344 deletions
18
app.py
18
app.py
|
|
@ -492,8 +492,8 @@ def execute_agent_task(agent_key, user_prompt, extra_context=""):
|
|||
# Memory-Zusammenfassung laden
|
||||
memory_summary = get_agent_memory_summary(agent_key)
|
||||
|
||||
# Wissensdatenbank-Pfad (Agent holt sich selbst was er braucht)
|
||||
kb_file = os.path.join(os.path.dirname(__file__), 'diversityball_knowledge.md')
|
||||
# Wissensdatenbank-Pfad (im Orchestrator-Ordner)
|
||||
kb_file = os.path.join(os.path.dirname(__file__), 'agents', 'orchestrator', 'knowledge', 'diversityball_knowledge.md')
|
||||
|
||||
# Team-Members laden (nur für Orchestrator)
|
||||
team_summary = ""
|
||||
|
|
@ -999,7 +999,7 @@ Bitte entscheide ob dieser Agent erstellt werden soll.""",
|
|||
# Wenn Agent Wissensdatenbank lesen will, füge relevante Sektion zur Antwort hinzu
|
||||
# (wird im Response-Text nicht sichtbar, aber Agent bekommt es als Context)
|
||||
if read_kb_requests:
|
||||
kb_file = os.path.join(os.path.dirname(__file__), 'diversityball_knowledge.md')
|
||||
kb_file = os.path.join(os.path.dirname(__file__), 'agents', 'orchestrator', 'knowledge', 'diversityball_knowledge.md')
|
||||
if os.path.exists(kb_file):
|
||||
with open(kb_file, 'r', encoding='utf-8') as f:
|
||||
kb_content = f.read()
|
||||
|
|
@ -1174,7 +1174,7 @@ def create_new_agent(agent_key, role, skills):
|
|||
return True
|
||||
|
||||
def load_knowledge_base():
|
||||
kb_path = os.path.join(os.path.dirname(__file__), 'diversityball_knowledge.md')
|
||||
kb_path = os.path.join(os.path.dirname(__file__), 'agents', 'orchestrator', 'knowledge', 'diversityball_knowledge.md')
|
||||
if os.path.exists(kb_path):
|
||||
with open(kb_path, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
|
@ -2231,7 +2231,7 @@ def chat_send():
|
|||
dirs = ensure_agent_structure(agent_key)
|
||||
work_dir = dirs['work_dir']
|
||||
memory_summary = get_agent_memory_summary(agent_key)
|
||||
kb_file = os.path.join(os.path.dirname(__file__), 'diversityball_knowledge.md')
|
||||
kb_file = os.path.join(os.path.dirname(__file__), 'agents', 'orchestrator', 'knowledge', 'diversityball_knowledge.md')
|
||||
|
||||
team_summary = ""
|
||||
if agent_key == 'orchestrator':
|
||||
|
|
@ -2358,7 +2358,7 @@ def agent_stream():
|
|||
agent_name = agent_info.get('name', selected_agent)
|
||||
system_prompt = get_agent_prompt(selected_agent)
|
||||
|
||||
kb_file = os.path.join(os.path.dirname(__file__), 'diversityball_knowledge.md')
|
||||
kb_file = os.path.join(os.path.dirname(__file__), 'agents', 'orchestrator', 'knowledge', 'diversityball_knowledge.md')
|
||||
kb_content = ""
|
||||
if os.path.exists(kb_file):
|
||||
with open(kb_file, 'r', encoding='utf-8') as f:
|
||||
|
|
@ -2378,13 +2378,17 @@ def agent_stream():
|
|||
yield f"data: {json.dumps({'type': 'processing', 'message': f'⏳ {agent_name} arbeitet...'})}\n\n"
|
||||
|
||||
try:
|
||||
# Agent work directory sicherstellen
|
||||
dirs = ensure_agent_structure(selected_agent)
|
||||
work_dir = dirs['work_dir']
|
||||
|
||||
model = get_agent_model(selected_agent)
|
||||
proc = subprocess.Popen(
|
||||
['opencode', 'run', '--model', model, '--format', 'json', full_prompt],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
text=True,
|
||||
cwd=os.path.dirname(__file__)
|
||||
cwd=work_dir # Agent arbeitet in seinem work-Verzeichnis
|
||||
)
|
||||
|
||||
# Jede Zeile sofort aus opencode lesen und streamen
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue