Add engine v2 action discovery metadata#2876
Add engine v2 action discovery metadata#2876henrypark133 merged 8 commits intov2-engine-prompt-lifecycle-alignmentfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements an action discovery system that enables models to retrieve detailed metadata, including curated summaries and schema overrides, through a new tool_info action. Key changes include adding discovery fields to ActionDef, incorporating an available_actions_snapshot into the ThreadExecutionContext, and centralizing mission-related action definitions. Review feedback focuses on centralizing name-matching logic (handling hyphen and underscore normalization) within ActionDef for better consistency and performance, and improving error feedback in the bridge when an action cannot be resolved.
There was a problem hiding this comment.
Pull request overview
This PR adds engine-v2 action discovery metadata so tool_info(...) and prompt surfaces can access canonical discovery names, curated summaries, and (optionally) richer discovery schemas without widening the callable tool surface.
Changes:
- Extended
ironclaw_engine::ActionDefwith optionalActionDiscoveryMetadata(+ helper methods for discovery name/schema/summary and name alias matching). - Added bridge-side action discovery plumbing: projected tool-backed actions now carry discovery metadata; mission action metadata moved into a dedicated
engine_actionsmodule. - Updated engine-v2 execution paths to snapshot callable actions into
ThreadExecutionContextsotool_infocan resolve engine-native actions that aren’t ToolRegistry-backed.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/engine_v2_skill_codeact.rs | Updates test ActionDef literals to include the new discovery field. |
| tests/engine_v2_sandbox_integration.rs | Updates ThreadExecutionContext construction to include available_actions_snapshot. |
| tests/engine_v2_gate_integration.rs | Updates test ActionDef literals and ThreadExecutionContext construction for new discovery/snapshot fields. |
| src/tools/mod.rs | Re-exports ToolDiscoverySummary and require_* helpers for bridge/tool discovery code. |
| src/gate/approval.rs | Updates test ActionDef literal to include discovery. |
| src/bridge/router.rs | Routes mission actions via new engine_actions::mission_capability_actions() and updates context init. |
| src/bridge/mod.rs | Registers new bridge modules (action_discovery, engine_actions). |
| src/bridge/llm_adapter.rs | Adds tool description hinting to call tool_info when discovery metadata exists; updates tests. |
| src/bridge/engine_actions.rs | New module defining mission actions + curated discovery summaries/schemas for engine-v2 surfacing. |
| src/bridge/effect_adapter.rs | Adds snapshot-based canonical name resolution and snapshot-backed tool_info handling; adds tests. |
| src/bridge/action_projector.rs | Projects ToolRegistry tools into ActionDefs with discovery metadata (summary + schema override). |
| src/bridge/action_discovery.rs | New helper to resolve actions and serve tool_info responses from the callable-action snapshot. |
| crates/ironclaw_engine/src/types/capability.rs | Adds discovery metadata structs/field to ActionDef and alias-aware matches_name. |
| crates/ironclaw_engine/src/traits/effect.rs | Adds available_actions_snapshot to ThreadExecutionContext. |
| crates/ironclaw_engine/src/runtime/mission.rs | Updates ThreadExecutionContext construction for new snapshot field. |
| crates/ironclaw_engine/src/runtime/manager.rs | Updates test ActionDef literals for the new discovery field. |
| crates/ironclaw_engine/src/lib.rs | Re-exports ActionDiscoveryMetadata and ActionDiscoverySummary. |
| crates/ironclaw_engine/src/gate/tool_tier.rs | Updates test ActionDef literal to include discovery. |
| crates/ironclaw_engine/src/gate/pipeline.rs | Updates test ActionDef literal to include discovery. |
| crates/ironclaw_engine/src/gate/lease.rs | Updates test ActionDef literal to include discovery. |
| crates/ironclaw_engine/src/executor/thread_context.rs | Updates ThreadExecutionContext construction for new snapshot field. |
| crates/ironclaw_engine/src/executor/structured.rs | Updates tests/context construction and ActionDef literals for discovery/snapshot fields. |
| crates/ironclaw_engine/src/executor/scripting.rs | Uses matches_name for alias-aware preflight + ensures gate paused action names are canonical. |
| crates/ironclaw_engine/src/executor/prompt.rs | Updates test ActionDef literal to include discovery. |
| crates/ironclaw_engine/src/executor/orchestrator.rs | Populates action snapshot and canonicalizes names for single/parallel action execution paths. |
| crates/ironclaw_engine/src/executor/loop_engine.rs | Updates test ActionDef literals to include discovery. |
| crates/ironclaw_engine/src/executor/context.rs | Updates ThreadExecutionContext construction for new snapshot field. |
| crates/ironclaw_engine/src/capability/registry.rs | Updates test ActionDef literals to include discovery. |
| crates/ironclaw_engine/src/capability/policy.rs | Updates test ActionDef literal to include discovery. |
| crates/ironclaw_engine/src/capability/planner.rs | Updates test ActionDef literal to include discovery. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* Add deferred action inventory groundwork * fix(engine): address deferred action inventory follow-up * fix(engine): address deferred inventory review feedback * test: fix fmt and clippy failures
…ment' into v2-engine-action-discovery-metadata # Conflicts: # crates/ironclaw_engine/src/executor/loop_engine.rs
d7f1fd5
into
v2-engine-prompt-lifecycle-alignment
* fix(engine): align prompt metadata refresh with resume state * fix(engine): finish prompt refresh compaction coverage (#2869) * fix(engine): preserve prompt refresh on resume (#2869) * Add engine v2 action discovery metadata (#2876) * Add engine v2 action discovery metadata * fix(engine): address action discovery review (#2876) * fix(engine): address follow-up review comments (#2876) * fix(engine): satisfy clippy in orchestrator lookup * fix(engine): propagate action snapshots in executor paths (#2876) * fix(bridge): restrict tool_info to callable actions (#2876) * [codex] Finish engine v2 deferred action inventory cleanup (#2889) * Add deferred action inventory groundwork * fix(engine): address deferred action inventory follow-up * fix(engine): address deferred inventory review feedback * test: fix fmt and clippy failures
…#2868) * engine-v2: make available_actions callable-only for blocked providers * fix(engine): address review fixture tempdir leak (#2868) * engine-v2: refresh canonical prompt metadata on resume (#2869) * fix(engine): align prompt metadata refresh with resume state * fix(engine): finish prompt refresh compaction coverage (#2869) * fix(engine): preserve prompt refresh on resume (#2869) * Add engine v2 action discovery metadata (#2876) * Add engine v2 action discovery metadata * fix(engine): address action discovery review (#2876) * fix(engine): address follow-up review comments (#2876) * fix(engine): satisfy clippy in orchestrator lookup * fix(engine): propagate action snapshots in executor paths (#2876) * fix(bridge): restrict tool_info to callable actions (#2876) * [codex] Finish engine v2 deferred action inventory cleanup (#2889) * Add deferred action inventory groundwork * fix(engine): address deferred action inventory follow-up * fix(engine): address deferred inventory review feedback * test: fix fmt and clippy failures * engine-v2: trim unused callable discovery payload * tests: restore env vars in review-fix cases * engine-v2: populate callable snapshots consistently * Unify v2 integration enablement on tool_activate * engine-v2: tighten tool_info inventory and approvals * llm: normalize tool_info hint syntax * engine-v2: tighten tool_activate install approval lookup * tests: align gmail settings-first flow with approval contract * engine-v2: fix remaining tool surface review issues * engine-v2: restore auto-approve defaults * fix(engine): align v2 tool permissions with defaults * fix(engine): close v2 callable snapshot gaps * fix(bridge): label latent-only providers accurately
Summary
ActionDefand expose it through the engine cratetool_inforead from the callable action snapshot first so advertised actions likemission_createare discoverable without changing callable exposure policyTesting
Closes #2793
Part of #2834 and Section 6 of #2767.