Skip to content

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

Open
Oberonskii wants to merge 2 commits into
extra-org:mainfrom
Oberonskii:fix/orchestrator-load-both-prompt-files
Open

fix(orchestrator): load both system and orchestrator prompt files#39
Oberonskii wants to merge 2 commits into
extra-org:mainfrom
Oberonskii:fix/orchestrator-load-both-prompt-files

Conversation

@Oberonskii

Copy link
Copy Markdown

Description

OrchestratorNode.__call__ was 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 and fall back to the brief YAML description field.

What was changed

In src/agent_engine/engine/langgraph/nodes.py, the OrchestratorNode.__call__ method now loads both system and orchestrator prompt files and combines them into the final prompt. When neither file is configured, description is used as a last-resort fallback, preserving backward compatibility.

How it was tested

  • All 525 existing tests pass (including 14 engine flow tests that exercise orchestrator routing)
  • The change follows the same load_file pattern already used by AgentNode._build_prompt
  • Backward compatible: when both prompt files are absent (as in existing tests with empty OrchestratorPromptSet()), behavior falls through to description unchanged

Related issue

OrchestratorNode.__call__ was 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.

Now both prompt files are loaded and combined. When neither is configured,
description is used as a last-resort fallback, preserving backward
compatibility with existing configs that rely on description only.

Fixes extra-org#38
Comment thread uv.lock Outdated
@@ -0,0 +1,3059 @@
version = 1

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.

We are working with the build tool that call poertry please make an alignment

@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.

We are working with the build tool that call poertry please make an alignment

@AmitAvital1

Copy link
Copy Markdown
Collaborator

Please star the project so i can assign to you the issue

@Oberonskii

Copy link
Copy Markdown
Author

Update: Habe die uv.lock entfernt. Das Projekt verwendet Poetry fürs Dependency-Management – das war mein Fehler, die uv.lock hatte da nichts zu suchen. Der eigentliche Bugfix (beide Prompt-Files laden) bleibt erhalten. Nur noch 5 Zeilen Diff. 👍

@Oberonskii

Copy link
Copy Markdown
Author

Removed the uv.lock file — this project uses Poetry for dependency management, so the lockfile was out of place. The actual bugfix (loading both prompt files) is unchanged. Down to just 5 lines of diff now.

@Asaf-prog

Copy link
Copy Markdown
Collaborator

please write in english.
in addition, can you share a screenshot of lungfuse? it a critical bug and we need an extra validation before merge.
you need to create an api key in langfuse and add it inside the .env file, and the engine will automatically integrate and present the stack

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

3 participants