Repository navigation
feat(agents): let delegated child tasks own pull request watches - #611
Merged
Merged
Conversation
Carry-Group: incubator Carry-Fix: #482 Carry-Observation: Watch ownership, task finality, injected guidance and feature evals depend on the existing Incubator delegation layer and ship together. Co-Authored-By: OpenAI Codex <[email protected]>
Carry-Group: incubator Carry-Fix: #482 Carry-Observation: Records measured context for the owned-watch feature and its model-facing guardrails.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Derive discovery visibility from server-issued child identity, while retaining exact native-call authorization for mutations. Refresh migration expectations for the new watch index. Carry-Group: incubator Carry-Fix: #482 Carry-Observation: Real provider discovery precedes native call metadata; the ownership decider remains authoritative.
…anges Keep discovery classification stable for a live MCP client; current watch mutation ownership remains authoritative. Cover shared-runtime reattachment after remote-task settlement. Carry-Group: incubator Carry-Fix: #482 Carry-Observation: Discovery visibility must not revoke the credential retained by an already-open shared provider client.
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
3 of 4 tasks
This was referenced Nov 15, 2026
lastobelus
added a commit
that referenced
this pull request
Nov 30, 2026
## Problem [#482](#482) Phase 4 delivered app-owned task PR-watch continuation in [#611](#611), but agent instructions still required build-specific approval. A destination that supports continuation should not also need that approval before a delegated child can own a watch. ## Change - **Support check:** The parent calls `orchestrator_capabilities` for the child's actual destination environment and confirms that `features.appOwnedPullRequestWatchContinuationVersion` is `1`. No build lookup or version guess is needed. - **Assignment:** The parent must also assign the watch in the delegated child's brief. - **Fallback:** Without the check and assignment, or if the watch is refused for lack of ownership support, the child hands off unfinished work and the parent owns the watch. - **Unchanged:** Current owners keep their watches. Owning a watch grants no merge authority. - **Consistency:** Updates agent instructions, the `watch_pull_request` tool description, docs, replay fixtures, an instruction test and eval cases, including cases for an assigned child without a capability receipt and a supported but unassigned child. ## Scope This fixes the leftover approval rule and replaces it in agent guidance; runtime logic does not change. Background waits for commands are accounted for separately in [#824](#824). ## Admission and the unassigned control The server **can** admit a live app-owned delegated child that calls the watch tool without a watch assignment in its brief. The [MCP handler](https://github.com/lastobelus/lastCode/blob/9c15a4feafbe74195e2db69d0267eeaa2ac1fea6/apps/server/src/mcp/toolkits/pullRequests/handlers.ts#L506-L520) passes authenticated execution provenance. [Registration](https://github.com/lastobelus/lastCode/blob/9c15a4feafbe74195e2db69d0267eeaa2ac1fea6/apps/server/src/orchestration-v2/Orchestrator.ts#L5359-L5443) requires the exact live delegated execution and a live task owner, and checks the existing watch generation’s owner when there is one. It does not check the brief for an assignment. The assignment rule is agent guidance. The first live run produced no unassigned child traces. A follow-up native control on this exact source passed with Codex GPT-6.2 Sol at xhigh. The parent verified version 1, dispatched one app-owned child, and kept the watch assignment. The child handed the pending review back, and neither called `watch_pull_request`. The child reported reading the description, but there was no separate description lookup in the trace. [Issue 914](#914) tracks the blocked samples. ## Verification - **Tests:** 591 focused tests passed. - **Checks:** Changed-file checks passed. - **Replay dry runs:** Six built successfully for each of Codex and Claude. - **Agent context:** compared with the base, the Claude and Codex instruction payloads each shrank by 228 bytes and the MCP tool list shrank by 62 bytes. - **Native wording check:** two assigned Codex Luna samples on the final source registered the watch, ran one pending gate check, stayed unfinished, then handled a real review wake and unwatched. One repeated the capability check, and one delegation call had a parameter error before dispatch. Four candidate samples (including all three unassigned controls) and three baseline samples stopped before delegation after reporting missing native tools. This gives two complete watch traces and no paired comparison. Local review: 3 rounds with GPT-6.1 Terra (xhigh) at 9c15a4f, approved. Implemented with Codex GPT-6.2 Sol in T3 Code. Guidance written with Claude Opus 5.5. Carry-Source-Ref: refs/lastcode/carry-sources/pr-913/9c15a4feafbe74195e2db69d0267eeaa2ac1fea6 Carry-Source-Base: e5d27a1 Carry-Source-Head: 9c15a4f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A delegated child that waits on a pull request has to end its turn and hand the watch to its parent. This PR lets an app-owned child keep the watch itself: it stays one unfinished task, handles real CI and review events as they arrive, and returns a single final result to its parent.
How ownership and events work
Rollout stays gated
Ordinary child watches need both the new capability and an explicit #482 acceptance of the identified installed Phase 4 checkpoint. Merging this does not grant that acceptance, and existing parent-mediated watches do not transfer automatically. Phase 3 stays accepted on its recorded checkpoint.
Not in this PR: UI, a production install, restart or checkpoint, merge-authority changes.
Agent context growth
Guidance for the new flow adds a small, measured amount of agent context:
Checks
Earlier integrated source validation
Focused checks
48a968acc95188c20afe079cbe3011d5f3a3bc28against basec8ecf0d8509de27c377dfed86f64a65da912b3db.Runtime result and remaining acceptance
Part of #482; it does not fix it. Phase 4 installed and real-use acceptance remain separate.
Implemented with Codex GPT-6.1 Sol; source review by Terra at xhigh.
Co-Authored-By: OpenAI Codex [email protected]