Skip to content

fix(orchestrator): load both system and orchestrator prompt files - #52

Merged
AmitAvital1 merged 2 commits into
extra-org:mainfrom
rishu685:fix/issue-38-orchestrator-prompts
Jul 27, 2026
Merged

fix(orchestrator): load both system and orchestrator prompt files#52
AmitAvital1 merged 2 commits into
extra-org:mainfrom
rishu685:fix/issue-38-orchestrator-prompts

Conversation

@rishu685

Copy link
Copy Markdown
Contributor

OrchestratorNode.__call__ was previously only reading self._spec.prompts.system, silently dropping the orchestrator prompt file (self._spec.prompts.orchestrator). This meant routing instructions configured in orchestrator.md were never sent to the LLM, causing the orchestrator to lose its routing context.

What was changed

  1. Updated OrchestratorNode.__call__ in src/agent_engine/engine/langgraph/nodes.py to load*both system and orchestrator prompt files and combine them.
  2. Kept description as a last-resort fallback when neither prompt file is configured, preserving backward compatibility.
  3. Added a comprehensive async test case test_orchestrator_loads_both_prompts in tests/engine/test_engine_flow.py covering all four possible configurations:
    • Both system and orchestrator prompts provided.
    • Only system prompt provided.
    • Only orchestrator prompt provided.
    • Neither provided (falls back to description).
  4. Cast the mock models to Any using cast(Any, ...) to satisfy strict type-checking checks.

Verification Results

  • Pytest: 533 passed (including the new test cases).
  • Ruff: All checks passed!
  • Mypy: Success: no issues found in 167 source files.

Related Issue

@rishu685
rishu685 force-pushed the fix/issue-38-orchestrator-prompts branch from 81e2561 to a137e00 Compare July 26, 2026 05:30
Comment thread src/agent_engine/engine/langgraph/nodes.py Outdated

@AmitAvital1 AmitAvital1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comment and can be approved
nice fast work 🚀

orchestrator is the required routing prompt. system is the optional
persona prefix prepended when present. When orchestrator is absent,
fall back to description for backward compatibility.

Closes extra-org#38
@rishu685
rishu685 force-pushed the fix/issue-38-orchestrator-prompts branch from a137e00 to 8b1eec5 Compare July 26, 2026 16:37
@rishu685
rishu685 requested a review from AmitAvital1 July 26, 2026 16:39
@rishu685

rishu685 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Done made the required changes!

Comment thread src/agent_engine/engine/langgraph/nodes.py Outdated
Comment thread src/agent_engine/engine/langgraph/nodes.py Outdated
Comment thread src/agent_engine/engine/langgraph/nodes.py Outdated
@rishu685
rishu685 force-pushed the fix/issue-38-orchestrator-prompts branch from e205684 to 3097b0b Compare July 27, 2026 06:05
Always join system and orchestrator prompts directly without an conditional check,
satisfying the reviewer feedback.

Closes extra-org#38
@rishu685
rishu685 force-pushed the fix/issue-38-orchestrator-prompts branch from 3097b0b to 677cca2 Compare July 27, 2026 06:30
@AmitAvital1
AmitAvital1 merged commit 65b2812 into extra-org:main Jul 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Orchestrator prompt not attached: falls back to description, losing context

2 participants