Commit 83a38b4
refactor: unify orchestrator and cognitive agent execution paths
The orchestrator is now a cognitive-mode agent — identical in structure to
any child agent. Key changes:
- orchestrator/__init__.py: mode=COGNITIVE with provider fallback chain,
cognitive_model, tools=["atn_full"], and system_prompt directly on
AgentDefinition (no more pipeline steps wrapper)
- runtime.py: Single _execute_cognitive_agent() handles ALL cognitive agents.
Orchestrator vs child differences are configuration-driven:
* Tool surface: "atn_full" vs "atn_core" (from defn.tools)
* Provider lifecycle: orchestrator reuses; children create fresh
* Conversation: orchestrator records to global store; children to per-agent
* Session resume: orchestrator uses BridgeProvider session_id
- runtime.py: New route_tool_call() method — universal tool router for all
cognitive agents (shell tools, MCP connectors, ATN framework tools)
- runtime.py: New _resolve_provider_by_name() properly maps provider names
(claude_max, anthropic, gemini, openai, ollama) to provider instances with
the correct model, fixing the provider fallback chain
- runtime.py: interrupt_orchestrator() now delegates to interrupt_delegate()
- runtime.py: _get_bridge_provider() now uses _active_providers uniformly
- ws_server.py: orchestrator_message handler uses _active_providers directly
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 6fcc3f3 commit 83a38b4
7 files changed
Lines changed: 437 additions & 286 deletions
File tree
- atn
- orchestrator
- providers
- steps
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
272 | 285 | | |
273 | 286 | | |
274 | 287 | | |
| |||
386 | 399 | | |
387 | 400 | | |
388 | 401 | | |
389 | | - | |
| 402 | + | |
| 403 | + | |
390 | 404 | | |
391 | 405 | | |
392 | 406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
294 | 295 | | |
295 | 296 | | |
296 | 297 | | |
297 | | - | |
298 | | - | |
299 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
300 | 301 | | |
301 | 302 | | |
302 | 303 | | |
| |||
365 | 366 | | |
366 | 367 | | |
367 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
368 | 374 | | |
369 | 375 | | |
370 | 376 | | |
| |||
393 | 399 | | |
394 | 400 | | |
395 | 401 | | |
396 | | - | |
397 | 402 | | |
398 | 403 | | |
399 | 404 | | |
| |||
403 | 408 | | |
404 | 409 | | |
405 | 410 | | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
| 411 | + | |
418 | 412 | | |
419 | 413 | | |
420 | 414 | | |
421 | 415 | | |
| 416 | + | |
422 | 417 | | |
423 | 418 | | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
431 | 423 | | |
432 | 424 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
242 | 245 | | |
243 | 246 | | |
244 | 247 | | |
| |||
386 | 389 | | |
387 | 390 | | |
388 | 391 | | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
426 | 400 | | |
427 | | - | |
| 401 | + | |
428 | 402 | | |
429 | 403 | | |
430 | | - | |
431 | 404 | | |
432 | | - | |
433 | | - | |
434 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
435 | 408 | | |
436 | 409 | | |
437 | | - | |
438 | | - | |
439 | | - | |
| 410 | + | |
440 | 411 | | |
441 | | - | |
| 412 | + | |
442 | 413 | | |
443 | 414 | | |
444 | | - | |
445 | 415 | | |
| 416 | + | |
| 417 | + | |
446 | 418 | | |
447 | 419 | | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
448 | 454 | | |
449 | 455 | | |
450 | 456 | | |
| |||
0 commit comments