fix(conductor): Apply review suggestions for track 'mma_data_architecture_dag_engine'

This commit is contained in:
2026-02-27 20:20:01 -05:00
parent c15e8b8d1f
commit 6548ce6496
3 changed files with 102 additions and 32 deletions

View File

@@ -2088,11 +2088,24 @@ class App:
track_id = f"track_{uuid.uuid4().hex[:8]}"
track = Track(id=track_id, description=title, tickets=tickets)
# 4. Initialize ConductorEngine and run_linear loop
# Initialize track state in the filesystem
from models import TrackState, Metadata
from datetime import datetime
now = datetime.now()
meta = Metadata(id=track_id, name=title, status="todo", created_at=now, updated_at=now)
state = TrackState(metadata=meta, discussion=[], tasks=tickets)
project_manager.save_track_state(track_id, state, self.ui_files_base_dir)
# 4. Initialize ConductorEngine and run loop
engine = multi_agent_conductor.ConductorEngine(track, self.event_queue)
# Use current full markdown context for the track execution
track_id_param = track.id
flat = project_manager.flat_config(self.project, self.active_discussion, track_id=track_id_param)
full_md, _, _ = aggregate.run(flat)
# Schedule the coroutine on the internal event loop
asyncio.run_coroutine_threadsafe(engine.run_linear(), self._loop)
asyncio.run_coroutine_threadsafe(engine.run(md_content=full_md), self._loop)
except Exception as e:
self.ai_status = f"Track start error: {e}"
print(f"ERROR in _start_track_logic: {e}")