Skip to content

Add parent-visible completion provider receipts - #414

Closed
GraciousGazelles wants to merge 11 commits into
agent/subagent-completion-provider-receiptfrom
agent/parent-completion-provider-receipt
Closed

GraciousGazelles wants to merge 11 commits into
agent/subagent-completion-provider-receiptfrom
agent/parent-completion-provider-receipt

Conversation

@GraciousGazelles

@GraciousGazelles GraciousGazelles commented Jul 14, 2026 •

Copy link
Copy Markdown
Collaborator

Stack

Summary

  • attach a runtime-authored provider receipt only to successful Completed child outcomes when provider evidence exists
  • place terminal response identity and exact turn usage before the child-controlled payload, keeping receipt-shaped child text untrusted
  • preserve the previous completion envelope exactly when provider evidence is absent or the child errors
  • preserve no-parent-outcome behavior for interrupted or budget-limited completion paths
  • forward the persisted TurnCompleteEvent evidence through the parent completion path

Boundaries

  • terminal model and snapshot identify only the terminal successful sampling response
  • usage comes only from Persist provider-observed complete-turn usage #411's exact aggregate of successful provider response completions in the logical turn
  • identity values are XML-escaped, invalid XML controls are replaced, and truncation is explicit after encoded-byte accounting
  • each escaped identity is bounded to 256 bytes, the receipt to 1,024 rendered bytes, and the complete item to 3,996 rendered bytes, including bounded task/sender paths and payload
  • receipt overflow falls back to a well-formed omission marker instead of emitting malformed or partial receipt markup

Review follow-up

  • the receipt renderer intentionally keeps its small line-oriented construction so the final escaped 1,024-byte invariant and omission fallback stay explicit
  • identity escaping uses a single loop, enforces encoded UTF-8 bytes rather than source-character count, replaces invalid XML controls, and returns an explicit truncation signal
  • both review threads covering those decisions have been replied to and resolved

Final refresh validation

  • cargo fmt -p codex-core -p codex-protocol -- --check from codex-rs
  • git diff --check 3bc32e94e0494e80b4b81f2332234f71d9061e99...HEAD
  • jq empty .github/validation-lanes.json docs/divergences/index.yaml
  • just downstream-docs-check
  • just --dry-run core-multi-agent-orchestration-targeted
  • static receipt audit: completed-only attachment, legacy error/interruption behavior, 256-byte escaped identity bound, 1,024-byte receipt bound, and 3,996-byte whole-item bound remain present
  • static recipe audit: three nextest commands, each with --no-tests=fail; receipt and Persist provider-observed complete-turn usage #411 re-entry selectors present; lane has needs_nextest: true

The PR-specific delta remains 449 additions and 14 deletions. No local Rust build, compile check, or test command was run for the final refresh; only the permitted targeted format check was run. No CI run was manually dispatched. The exact rendering, adversarial encoded-budget, completed/error/interruption boundary, provider-activity-then-error, and logical-turn re-entry regressions remain declared in the GitHub-hosted targeted lane.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a parent-visible completion provider receipt for MultiAgentV2 child completions, capturing terminal response model, snapshot, and turn provider usage, and rendering them in XML format. It also includes comprehensive tests and documentation updates. The review feedback suggests performance optimizations in inter_agent_completion_message.rs, specifically using std::fmt::Write in the render method to reduce allocations, and pre-allocating capacity with a for loop instead of fold in bounded_xml_value.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@GraciousGazelles
GraciousGazelles force-pushed the agent/parent-completion-provider-receipt branch from 8c9181e to 93cae9c Compare July 14, 2026 09:30
@GraciousGazelles
GraciousGazelles force-pushed the agent/subagent-completion-provider-receipt branch 2 times, most recently from c813b4b to 8c80eb5 Compare July 28, 2026 14:16
@GraciousGazelles

Copy link
Copy Markdown
Collaborator Author

Closing this dependent experiment as superseded by current-main PR #411. The worthwhile persistence-only provider-usage behavior is carried in #411; the parent-visible completion receipt is intentionally not merged independently. The current-main successor is being validated separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant