Skip to content

Add handoff-aware root context for Guardian reviews - #49057

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/87dc39158f78b2b7e9f4f2e4afc653257ea12025
Sep 28, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/87dc39158f78b2b7e9f4f2e4afc653257ea12025

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Add handoff-aware root context for Guardian reviews

What changed

Add the disabled-by-default guardian_root_handoff_context feature to select worker-specific root evidence for Guardian reviews. Use recorded spawn_agent, send_message, and followup_task calls targeting a worker or its ancestors to select the three preceding root messages per handoff, plus the three latest root messages so recent cancellations remain visible before another handoff.

Preserve verified tool answers and evidence without known ordering, and retain the existing shared message cap. Fall back to the existing root context when no usable handoff window remains or the latest authorization message is a heartbeat. Update the review context revision when the selection changes.

Testing

Add a delegation scenario and Guardian request snapshot covering ancestor handoffs, separate worker branches, cancellation visibility, and fallback after compaction removes handoff calls. Extend heartbeat coverage to exercise the new feature and verify that the latest turn's trusted skills are retained.

## What changed

Add the disabled-by-default `guardian_root_handoff_context` feature to select worker-specific root evidence for Guardian reviews. Use recorded `spawn_agent`, `send_message`, and `followup_task` calls targeting a worker or its ancestors to select the three preceding root messages per handoff, plus the three latest root messages so recent cancellations remain visible before another handoff.

Preserve verified tool answers and evidence without known ordering, and retain the existing shared message cap. Fall back to the existing root context when no usable handoff window remains or the latest authorization message is a heartbeat. Update the review context revision when the selection changes.

## Testing

Add a delegation scenario and Guardian request snapshot covering ancestor handoffs, separate worker branches, cancellation visibility, and fallback after compaction removes handoff calls. Extend heartbeat coverage to exercise the new feature and verify that the latest turn's trusted skills are retained.

GitOrigin-RevId: 87dc39158f78b2b7e9f4f2e4afc653257ea12025
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/87dc39158f78b2b7e9f4f2e4afc653257ea12025 branch from 471fd3a to 6288753 Compare September 28, 2026 18:51
@copyberry
copyberry Bot merged commit 6288753 into main Sep 28, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/87dc39158f78b2b7e9f4f2e4afc653257ea12025 branch September 28, 2026 18:51
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant