Skip to content

feat: expose guarded native Working Plan revisions - #310

Merged
EvanProgramming merged 1 commit into
mainfrom
Evan/v3-matched-eval
Oct 21, 2026
Merged

EvanProgramming merged 1 commit into
mainfrom
Evan/v3-matched-eval

Conversation

@EvanProgramming

@EvanProgramming EvanProgramming commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Partial implementation related to #267; evaluation acceptance remains open.

Root cause: the typed update_plan tool already had revision-checked persistence and Strategic Plan guards, but the native Agent tool boundary filtered it from permitted schemas and prompts.

Approach: expose its existing structured schema only in Agent mode when effective capabilities include write; Ask and Plan remain read-only, and the legacy textual tool inventory continues to hide the structured-only operation. The active capability token and existing Strategic Plan approval and binding checks remain authoritative. This reuses the current registry and executor rather than adding a second plan-edit API.

Validation: full make test (1,028 passed, 13 skipped); make check; make docs-check; focused native continuation and Working Plan tests. A fake native provider received the schema, revised a plan, and continued with another typed call. Commit is GPG-signed and verified.

Risk: models can now revise Working Plans in Agent mode when granted write capability; plan revision still does not authorize task execution or widen an accepted Strategic Plan. This PR depends on the existing V3 plan and capability foundations. #266 matched-evaluation fixtures and live cohort are separate follow-up work.

@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: aaa5163b-be29-44d3-b84a-ebbaeff18cb9
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ghfind-review ghfind-review Bot added area: architecture Agent runtime ownership, architecture boundaries, and typed events area: security Capabilities, approvals, scope boundaries, and OS sandboxing enhancement New feature or request labels Oct 21, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T13:18:53.205508Z 821af16 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 821af16dea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

def _agent_prompt_tools_list(self, agent_config: dict[str, Any]) -> str:
"""Build the inventory within config, active token and interaction bounds."""
permitted = self._permitted_tool_names(agent_config) - {"update_plan"}
permitted = self._permitted_tool_names(agent_config)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep update_plan out of legacy tool inventories

For text-only providers in Agent mode, _build_messages() and the legacy action-round prompts both populate their tool list through _agent_prompt_tools_list, so this change advertises update_plan through the string-based Action protocol as well as through native schemas. That conflicts with the native-only behavior documented by this change and gives legacy models only a prose description rather than the structured revision schema, leading to malformed plan calls or unintended JSON-string plan mutations. Keep it excluded from textual inventories and expose it only through the native provider schema set.

AGENTS.md reference: AGENTS.md:L35-L35

Useful? React with 👍 / 👎.

Comment on lines +57 to +59
permitted = {name for name in self.AVAILABLE_TOOLS if self.tool_registry.get_spec(name).visibility == 'public' and tool_capability(name,self.AVAILABLE_TOOLS) in capabilities}
if self._active_interaction_mode.get() != "agent":
permitted.discard("update_plan")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Return the plan revision after native plan creation

When a native model first calls the newly exposed update_plan tool with the supported complexity/tasks form, _update_plan() returns the plan ID and task IDs but omits plan.revision. Every subsequent structured edit requires expected_revision, so the model cannot reliably issue a revision—especially when this form updated an already-active plan whose revision is not predictably 1. Include the resulting revision in the creation/update response before advertising this tool to native providers.

Useful? React with 👍 / 👎.

Comment on lines +57 to +59
permitted = {name for name in self.AVAILABLE_TOOLS if self.tool_registry.get_spec(name).visibility == 'public' and tool_capability(name,self.AVAILABLE_TOOLS) in capabilities}
if self._active_interaction_mode.get() != "agent":
permitted.discard("update_plan")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add native task binding before exposing plan creation

For a direct native Agent turn that uses the newly advertised update_plan schema to create tasks, subsequent tool calls cannot be associated with any returned task ID: AgentEngine._run_native() sets each call's task_id only from _delegation_task_id, which is None for foreground work, and records receipts with legacy matching disabled. Since neither ToolCall nor the individual tool schemas provide another task-ID channel, execution and verification receipts never advance these tasks, so a complex Working Plan created by the model remains pending and the turn is reported incomplete regardless of successful tool work.

Useful? React with 👍 / 👎.

@EvanProgramming
EvanProgramming merged commit e0f9363 into main Oct 21, 2026
21 of 23 checks passed
@EvanProgramming
EvanProgramming deleted the Evan/v3-matched-eval branch October 21, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: architecture Agent runtime ownership, architecture boundaries, and typed events area: security Capabilities, approvals, scope boundaries, and OS sandboxing enhancement New feature or request review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant