Skip to content

[codex] Fix v2 tool_info action inventory lookup - #2994

Merged
serrrfirat merged 2 commits into
stagingfrom
fix/mission-schema
Apr 27, 2026
Merged

serrrfirat merged 2 commits into
stagingfrom
fix/mission-schema

Conversation

@henrypark133

Copy link
Copy Markdown
Collaborator

Summary

Fixes v2 tool_info discovery so it resolves against the current ActionInventory surface instead of falling back to the global ToolRegistry. This lets engine-native actions like mission_create return schema details even though they are not registered builtin tools, and prevents tool_info from explaining globally registered tools that are not callable/discoverable in the current v2 context.

Also removes the hardcoded mission_* Python signatures from the CodeAct preamble so compact tools are discovered through the runtime action surface and tool_info(..., detail="schema").

Root cause

The model could follow the prompt and call tool_info(name="mission_create", detail="schema"), but the executed path could still hit registry-backed lookup. Since mission_create is engine-native and lives in ActionInventory, not ToolRegistry, that produced No tool named 'mission_create' is registered.

Validation

  • cargo fmt
  • cargo test tool_info --lib
  • cargo test -p ironclaw_engine tool_info --lib
  • cargo test -p ironclaw_engine prompt_renders_compact_enabled_tools_once_with_schema_instruction --lib
  • git diff --check

Notes

This PR intentionally keeps mission_create outside ToolRegistry; the v2 source of truth is the current action inventory.

@github-actions github-actions Bot added scope: docs Documentation size: L 200-499 changed lines risk: low Changes to docs, tests, or low-risk modules contributor: new First-time contributor labels Apr 27, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the agent's tool discovery mechanism by removing hardcoded tool signatures from the system prompt and introducing a dynamic schema retrieval system via tool_info(name="<tool>", detail="schema"). The changes include updates to the codeact_preamble.md, enhancements to the tool_info implementation in both scripting and structured executors to support schema lookups, and improved error handling in the bridge to handle missing action snapshots. I have no feedback to provide as the review comments did not point out actionable issues in the current code changes.

@henrypark133
henrypark133 marked this pull request as ready for review April 27, 2026 18:42
Copilot AI review requested due to automatic review settings April 27, 2026 18:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes v2 tool_info discovery to resolve against the current per-context action surface (ActionInventory / action snapshots) instead of falling back to the global ToolRegistry, and updates CodeAct prompt content to rely on runtime schema discovery rather than hardcoded mission signatures.

Changes:

  • Update EffectBridgeAdapter’s tool_info execution path to prefer available_action_inventory_snapshot, then available_actions_snapshot, and error when neither is present (no ToolRegistry fallback).
  • Add/adjust tests across bridge + executors to cover schema lookup for engine-native / non-registry actions and prevent registry leakage.
  • Remove hardcoded mission tool signatures from the CodeAct preamble and tighten prompt assertions accordingly.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/bridge/effect_adapter.rs Switch tool_info snapshot lookup to ActionInventory-first, add regression tests to prevent ToolRegistry fallback.
src/bridge/action_discovery.rs Add test helpers and new unit tests validating detail="schema" / include_schema behavior and schema overrides.
crates/ironclaw_engine/src/executor/structured.rs Update test stubs/inventory to support tool_info schema resolution; add structured execution regression test.
crates/ironclaw_engine/src/executor/scripting.rs Update scripting test stub + test to validate schema resolution via propagated ActionInventory snapshot.
crates/ironclaw_engine/src/executor/prompt.rs Assert prompt no longer embeds hardcoded mission Python signatures.
crates/ironclaw_engine/prompts/codeact_preamble.md Remove hardcoded mission_* signatures and instruct dynamic schema discovery via tool_info(..., detail="schema").

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/ironclaw_engine/src/executor/structured.rs
@github-actions github-actions Bot added contributor: core 20+ merged PRs and removed contributor: new First-time contributor labels Apr 27, 2026

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

Reviewed changed files in full and ran targeted tool_info test coverage locally. No blocking findings.

@serrrfirat
serrrfirat merged commit 91c4c7c into staging Apr 27, 2026
17 checks passed
@serrrfirat
serrrfirat deleted the fix/mission-schema branch April 27, 2026 20:32
@henrypark133 henrypark133 mentioned this pull request Apr 29, 2026
This was referenced May 7, 2026
theredspoon pushed a commit to theredspoon/ironclaw that referenced this pull request Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs risk: low Changes to docs, tests, or low-risk modules scope: docs Documentation size: L 200-499 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants