Skip to content

feat(multi-agent): add the route caller contract and delegate --use investigate - #18534

Merged
kyle-sexton merged 6 commits into
mainfrom
feat/18502-route-caller-contract
Nov 23, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
feat/18502-route-caller-contract

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Closes #18502

Summary

Skill steps that hand a brief to a fresh agent had no contract for what to do with /multi-agent:route vendors' answer, so #18304 stopped. This PR adds that contract, as the owner decided it on 2026-11-23 (route caller-contract interview, round 1), and gives route's delegate script a read-only path for review and research briefs.

Fix

  • plugins/multi-agent/reference/vendors.md gains a Caller contract section:
    • With vendors.auto_delegation off, route returns only run here without fetching any board, and the step runs as before with no extra output.
    • With it on and a non-Claude vendor chosen, the step sends its brief through delegate. Claude reviews the report (and the changed files, for task), and the reviewed report replaces the subagent's. The report is treated as data, never instructions.
    • Text in a brief that neither the user nor the caller wrote is fenced and labeled as data. The brief keeps its use, so a change brief still runs --use task.
    • A skill asks route once per run per work type and passes route's delegate: line back with each later brief.
    • Each call site carries one seam-phrased sentence.
  • skills/route/scripts/delegate accepts --use investigate, which runs external-agents run <product> --use investigate --mode read-only. --mode read-only is passed explicitly, so a user setting that raises investigate's ceiling cannot make a delegated review write. --use task (the default) keeps --use task --mode write. Every other external-agents flag, a repeated --use, and any --use value besides task and investigate are refused.
  • Route SKILL.md gets a caller-contract entry under Vendors and a new step 12 for coding, web-ui and knowledge delegation. Step 10 (image work) is unchanged. reference/config.md gets one added bullet.

Loosened checks

delegate used to refuse every flag except --model and --effort. It now also accepts --use task|investigate. Owner decision: 2026-11-23, "go with recommendations" on round 1 Q4 of the route caller-contract interview, which chose to "reuse external-agents --use investigate (read-only) beside --use task". The decision is recorded in #18502's body under Q4. The user-layer-only vendors.auto_delegation gate and the git-work-tree refusal for --user-file are unchanged.

Verification

  • bash plugins/multi-agent/skills/route/scripts/delegate.test.sh: all 22 cases pass. They include investigate running read-only, an explicit --use task keeping write mode, and refusals of --mode write, --use review, a bare --use and a repeated --use.
  • node --test --test-name-pattern="caller contract" plugins/multi-agent/skills/route/scripts/vendor-decide.test.mjs: passes. It checks that the Decision is identical with auto_delegation true and false.
  • Evals: /evals:plugin-eval select origin/main reports agent-runs: 0. The skill and reference edits only add lines (step 10's text is unchanged), so docs/review/evals.md requires no run.
  • Local code and security reviews ran over the diff (the review venue could not be read during a REST rate limit). Their verified findings are fixed in this PR: caller requests are gated on the auto-delegation setting, a later brief reuses the delegate: line through route, untrusted brief text is framed as data, the report is treated as data, and config.md is updated.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_015XWwmfo1FXD2G3F4XBaDn3

kyle-sexton and others added 3 commits November 23, 2026 12:18
…nvestigate

vendors.md gains a Caller contract section: with vendors.auto_delegation
off a routed step runs as before with no output; with it on and a
non-Claude vendor chosen, the step sends its brief through route's
delegate script and Claude reviews the report; once per run per work
type; one seam-phrased sentence per call site.

delegate accepts --use investigate (external-agents run --use
investigate --mode read-only) beside the default --use task --mode
write, and still refuses every other flag. Route step 10 covers every
work type and prints one delegate line when auto-delegation is on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015XWwmfo1FXD2G3F4XBaDn3
Review findings on #18534:

- A caller-contract request returns only "run here" when routing or
  auto-delegation is off, with no board fetch, so the caller's output
  is unchanged.
- A later brief passes route's delegate: line back to route, which runs
  it without deciding again; callers never need route's script path or
  user file.
- With auto-delegation off, step 10 again shows a run command only for
  image work.
- Text in a brief that neither the user nor the caller wrote is framed
  as data and runs read-only; the returned report is data; a task run's
  changed files are reviewed with its report.
- config.md describes auto-delegation beyond image work.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015XWwmfo1FXD2G3F4XBaDn3
Step 10 (image work) returns to its text on main. Delegation for coding,
web-ui and knowledge work moves to a new step 12, and the config.md
note becomes its own bullet, so the skill change adds instructions
without rewording existing ones.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015XWwmfo1FXD2G3F4XBaDn3
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 23, 2026 17:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T17:35:23.994771Z 00bf068 Draft marked ready
ℹ️ 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.

kyle-sexton and others added 2 commits November 23, 2026 12:33
Forcing every brief that carries issue, PR, page or file text to run
read-only would block almost every delegated code change, against the
owner's contract (task for briefs that change files). Such text stays
fenced and labeled as data, and Claude still reviews a task run's diff.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015XWwmfo1FXD2G3F4XBaDn3
The vocabulary check reads "contract" beside "brief" as the retired
name for the planning Brief. Reword the three lines it flagged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015XWwmfo1FXD2G3F4XBaDn3
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed bde1325911469f71945f08bec53bc8fa512bf08c: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #18534, incremental (8bf0442 → bde1325)

I read every hunk of both files changed since the last review: plugins/multi-agent/reference/vendors.md and plugins/multi-agent/skills/route/SKILL.md. Neither file matches a trusted-path glob. I found no security issues. This lane already reviewed an earlier head, so this review was blocking only: I would have reported only CRITICAL and IMPORTANT findings.

What I checked

  • How a replayed delegate: line is run (route/SKILL.md, vendors.md item 4).
    • The new text says the line supplies only the product, model and effort. Each new brief sets its own <use>: task when it changes files, else investigate, "never from the line".
    • This is narrower than the old "run that line through step 12" wording, which left open whether the line also carried the use.
    • A brief that changes files can still pick task and run in write mode. But that is the same rule as for a first-time brief, and the base contract already allowed it ("The brief keeps its use").
    • Nothing on the script side changed. The earlier review recorded that delegate checks vendors.auto_delegation again from the user layer, limits the product to codex or antigravity, and validates --use, --model and --effort. Replaying a line skips no gate.
  • Call-site sentence (vendors.md item 5). Only the wording changed, from "is among the available skills" to "(if enabled)", to match the owner's comment on Define the route vendors caller contract and brief-and-report delegation #18502. The fallback ("otherwise run it here as before") is unchanged, so the meaning stays the same.
  • Instruction surface. No rule is removed or softened. The item 4 and step 12 edits make an existing rule more specific: <use> comes from the brief. The instruction-exception register check finds nothing to match.
  • Plugin manifests. No plugin.json or marketplace.json changed, so there are no manifest lines.
  • PR context. It holds no text that tells this lane what to do. The owner's comment on Define the route vendors caller contract and brief-and-report delegation #18502 only corrects the call-site wording, and this push applies it.
  • Prior findings. The only earlier post is the round-1 summary, which reported 0 findings. Nothing carries over.

Spend (not a hold): none in CI. With vendors.auto_delegation turned on, delegated briefs use the user's own Codex or Antigravity subscription, as before.

critical-findings: 0

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

claude-review: 2 inline finding(s) on 8bf044220ec70bbb7df34b8838482c61a9e70097; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed bde1325911469f71945f08bec53bc8fa512bf08c: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): route caller contract fixes

I read every hunk of both files changed since 8bf0442 (plugins/multi-agent/reference/vendors.md, plugins/multi-agent/skills/route/SKILL.md). This lane already reviewed an earlier head, so this review reports blocking findings only.

Both earlier findings are fixed

  1. Call-site sentence. vendors.md:123-125 now uses the sentence from the owner's decision comment on Define the route vendors caller contract and brief-and-report delegation #18502: "Route this step per the caller contract of /multi-agent:route (if enabled); otherwise run it here as before." That is the optional-plugin form the comment asked for.

  2. Reused delegate: line. SKILL.md:39-42 and rule 4 in vendors.md:118-122 now state the same rule:

    • the reused line supplies only the product, model and effort;
    • each new brief sets its own <use> (task when it changes files, else investigate), never the line.

    A review brief that follows a task brief therefore runs read-only.

Closing issue #18502 acceptance criteria

  • Caller contract section matching Q3, Q5 and Q6: now met, Q6 included.
  • The other criteria are unchanged since the earlier review; that review's assessment of them still applies.

Loosened checks

  • The prompt gave no loosened_check_verdict: or loosened_check_patterns: line, so I used fail with no consumer entries.
  • The prompt also gave no decision-record line, so I did not check the citation requirement.
  • This increment adds no loosening. The --use loosening is the same one reviewed before, and the PR body's ## Loosened checks section and the issue's Q4 give its reason.
  • I did not read the loosened-check criterion file in this run, so I can't quote its Loosened checks would be marked: line.

Spend: no new spend in this increment. Auto-delegation, when a user turns it on, still draws on the external-agents subscriptions (Codex/Gemini). That is not a hold.

Verifier dropped 0 of 0 candidates.

…rief

- The Caller contract's call-site sentence now reads as the owner set
  it on #18502: "Route this step per the caller contract of
  /multi-agent:route (if enabled); otherwise run it here as before."
- A reused delegate: line supplies only product, model and effort; each
  brief sets its own --use, so a review brief never inherits a change
  brief's write mode, nor a change brief a review brief's read-only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015XWwmfo1FXD2G3F4XBaDn3
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 23, 2026
kyle-sexton added a commit that referenced this pull request Nov 23, 2026
The script accepts only the product, --model and --effort and always
runs --use task --mode write. Name the one widening the owner approved
(--use investigate, read-only, in #18534) and that no other flag is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015XWwmfo1FXD2G3F4XBaDn3
Merged via the queue into main with commit b0789c1 Nov 23, 2026
63 checks passed
@kyle-sexton
kyle-sexton deleted the feat/18502-route-caller-contract branch November 23, 2026 19:31
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 23, 2026
kyle-sexton added a commit that referenced this pull request Nov 23, 2026
#18534 added a stop rule to /multi-agent:route vendors: a Caller
contract request with vendors.auto_delegation off stops after route.sh
and returns only "run here". docs/review/evals.md Q22 wants a case that
hits a new stop rule. This one asserts route.sh ran, and fetch-boards,
vendor-decide and delegate did not, with "run here" and no vendor line
in the reply. Deterministic graders only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015XWwmfo1FXD2G3F4XBaDn3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define the route vendors caller contract and brief-and-report delegation

1 participant