fix(agent): drop removed memory_tree modes from orchestrator prompt#3275
Conversation
The memory_tree query tool dropped the `query_topic` and `query_global` modes when the global/topic trees were removed (see the assertions in src/openhuman/memory/query/mod.rs that these modes are gone), but two LLM-facing strings still advertised them: - orchestrator prompt.md listed `mode: "query_topic"` / `query_global` as valid modes, so the agent would emit calls that the dispatcher rejects with "unknown mode". It also never mentioned the real `walk` / `smart_walk` / `ingest_document` modes. - memory_tree_search_entities's tool description told the model to call a nonexistent `memory_tree_query_topic` tool. Align both with the dispatcher's actual modes: search_entities, query_source, drill_down, fetch_leaves, ingest_document, walk, smart_walk. Co-Authored-By: Claude <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe PR updates memory tree retrieval guidance across two files: the orchestrator prompt now describes expanded retrieval modes ( ChangesMemory Tree Retrieval Mode Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/openhuman/agent_registry/agents/orchestrator/prompt.md (1)
187-187: 💤 Low valueConsider consistent spelling variant.
The document uses British English spelling ("synthesise" on line 11), but line 187 uses American spelling "synthesized". For consistency, consider "synthesised".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openhuman/agent_registry/agents/orchestrator/prompt.md` at line 187, The phrase for the `mode: "walk"` description uses American spelling "synthesized" which is inconsistent with the British variant "synthesise" used elsewhere; update the text in the `mode: "walk"` line to use "synthesised" so the document consistently uses British English (search for the string `mode: "walk"` and replace "synthesized" with "synthesised").
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/openhuman/agent_registry/agents/orchestrator/prompt.md`:
- Line 187: The phrase for the `mode: "walk"` description uses American spelling
"synthesized" which is inconsistent with the British variant "synthesise" used
elsewhere; update the text in the `mode: "walk"` line to use "synthesised" so
the document consistently uses British English (search for the string `mode:
"walk"` and replace "synthesized" with "synthesised").
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 42aa277f-8a60-40c2-80a8-6b37350545c0
📒 Files selected for processing (2)
src/openhuman/agent_registry/agents/orchestrator/prompt.mdsrc/openhuman/memory/query/search_entities.rs
oxoxDev
left a comment
There was a problem hiding this comment.
Strings-only fix aligning the orchestrator memory_tree prompt + search_entities tool desc to the real dispatcher. Verified the prompt now lists exactly the 7 live modes (search_entities/query_source/smart_walk/walk/drill_down/fetch_leaves/ingest_document) matching memory/query/mod.rs:143-149; the stale query_topic/query_global are dropped (the memory_tree_schema_mode_enum_has_all_modes test pins this), and search_entities no longer points at the nonexistent memory_tree_query_topic. No logic change.
Necessity: problem real (stale strings → unknown-mode routing errors) · right size (+6/-4) · right approach (align to dispatcher truth, CI-guarded) · Ship.
Approve with one nit (inline).
…fs (tinyhumansai#2780) - prompt.md: presentation tool described as native Rust `ppt-rs` engine in-process (no python subprocess, no managed venv) instead of "bundled python-pptx helper" — matches engine.rs rustdoc post-engine-swap. - prompt.md: grounding-rule memory_tree modes trimmed to `query_source` / `smart_walk` — `query_topic` / `query_global` were removed by tinyhumansai#3275 because dispatcher rejects them with "unknown mode". - types.rs: rustdoc on validate_input swapped "before spawning Python / generic Python traceback" → "before invoking the ppt-rs engine / generic engine error". - tests/orchestrator_presentation_wiring.rs: code_executor exclusion rationale + assertion message now reference native Rust engine, not the removed `runtime_python` venv. graycyrus review on tinyhumansai#3029: both stale-text threads addressed; PR is rebased onto upstream/main which already carries tinyhumansai#3275's mode-list cleanup at the agent-prompt level.
Summary
query_topicandquery_globalmodes from the orchestrator'smemory_treedocumentation — both were deleted when the global/topic trees were removed, but two LLM-facing strings still advertised them.walk,smart_walk, andingest_document.memory_tree_search_entitiestool description, which pointed the model at a nonexistentmemory_tree_query_topictool.Problem
The
memory_treedispatcher (src/openhuman/memory/query/mod.rs) supports exactly:search_entities,query_source,drill_down,fetch_leaves,ingest_document,walk,smart_walk. Thequery_topic/query_globalmodes were removed with the global/topic trees (asserted gone inmod.rstests), but two prompts the model actually reads were never updated:orchestrator/prompt.mdstill listedmode: "query_topic"andmode: "query_global"as valid, and the "Start cheap (query_* summaries)" line leaned on them. If the orchestrator followed its prompt it would emit a call the dispatcher rejects withunknown mode. The prompt also never mentioned the more capablewalk/smart_walkretrieval paths, so the agent was blind to them.memory_tree_search_entities's tooldescription()told the model to call amemory_tree_query_topictool that does not exist.Solution
Align both LLM-facing strings with the dispatcher's real mode list — drop the two dead modes, document
smart_walk(multi-strategy retrieval) andwalk(agentic traversal) as the open-ended-query defaults, addingest_document, and updatesearch_entitiesto referencememory_tree's real retrieval modes.Submission Checklist
N/A: prompt/description string-only change — no executable behaviour to unit-test. The dispatcher already asserts the removed modes are gone (memory/query/mod.rs).N/A: behaviour-only change— no changed executable lines fordiff-cover.N/A: behaviour-only changeN/AN/A: does not touch release-cut surfacesN/A: no tracking issueImpact
search_entitiestool now describe only modes the tool actually accepts, eliminating a class of guaranteed-failingmemory_treecalls and surfacingsmart_walk/walk. No code-path or schema change.Related
query_topicmentions inmemory_tree/retrieval/{drill_down,types}.rscomments (non-LLM-facing).AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
Summary by CodeRabbit