step-3: add router refactor with streaming support (orchestrator.py)

- orchestrate_v3(user_id, message, context): classifies intent, returns
  (agent_name, agent_instance) — caller drives execution
- orchestrate_v3_stream(user_id, message, context): yields (agent_name, token)
  pairs; first yield is always (agent_name, "") as a domain-detection signal
- ChatAgent.handle_stream(): default implementation yields handle() result as
  one chunk; subclasses override for true token-level streaming
- Fix stale test_orchestrator.py assertions that expected a JSON final frame
  that orchestrate_stream never emitted

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 21:42:46 +01:00
parent 7cb384fa63
commit 2c08275934
5 changed files with 293 additions and 10 deletions

View File

@@ -119,7 +119,7 @@ pytest tests/test_orchestrator_v3.py
```
**Status**:
- [ ] Step 3 complete
- [x] Step 3 complete
**Commit**: After tests pass, commit with:
```