Repository navigation
Conversation
There was a problem hiding this comment.
Approve (0 findings)
Scope: base main, merge-base d4dd9255, 1 commit, 5 files reviewed. Helper skills: coderbook loaded; ponytail-review and karpathy-guidelines not loaded (their checklists were applied from the review skill's own list). Ran in a separate session.
Findings
None.
Verified as fine
declinedreally reaches the projection. Codex'scommandExecutionandfileChangecompletions passitem.StatusthroughcodexStatus, which only rewritesinProgress(apps/computer/local-daemon/internal/provider/native/codex_events.go:465-470). A declined command has no exit code, so theExitCode != 0 → failedoverride does not apply (codex_events.go:408-410), and a declined patch emitsStatus: "declined"with outputdeclined: N file changes(codex_events.go:422-424). Before this change,is_errorcovered onlyfailed/error/cancelled(internal/provider/executor.go:768), so these steps finished assucceeded, as the PR says.- Precedence and content.
declinedis checked beforeis_error(event_projection.go:160-166), and it cannot also setis_error. Onlyoutcome == "failed"gets theErrorlabel (event_projection.go:174-178), so a declined step publishes no content. Thereceiptbranch can still apply to a declinedteamhub task create, but Codex reports no output for a declined command, so no content is published there either. - The outcome is valid on every downstream hop. The Runner Gateway contract enum includes
declined(contracts/openapi/components/agent-runtime-state.yaml:1234). The Agent Service passesoutcomethrough unchanged (apps/node-services/src/agent/runner-gateway/remote-codex-provider.ts:1266-1274,apps/node-services/src/agent/executor/runtime-status.ts:208-218), andRuntimeActivityOutcomealready lists it (apps/node-services/src/agent/executor/provider.ts:213). TeamHub's validator accepts it (apps/teamhub/internal/agentruntimestate/status.go:443). No contract change or regeneration is needed. - Reply tracking.
ReplyDeliverynow counts a declined write as failed, which feedsreplyUndelivered(apps/node-services/src/agent/executor/reply-delivery.ts:41-52), and a declined read as a failed read (:36-38,:65). This matches the updated rule inapps/node-services/src/agent/AGENTS.md:84-85, so the docs move with the code in the same PR. - Tests.
TestDeclinedActivityEndsDeclinedcovers both Codex shapes (a patch with the summary output, a command with none). Without the fix it would getsucceeded, so it fails onmain. The newrun-loop.test.tscase checksreply_undeliveredand the logged counters for a declined write and a declined read. - PR description claims. They match the diff:
tool.returnedis unchanged, the contract is untouched, and the Web and task-row gaps are listed as out of scope. Nothing in the diff touches the user message →provider_readypath. - Conventions. No CJK in the added lines or the commit message. The comments explain why. There is no new env, config or cross-app import.
Process notes
- The PR is one commit: no merge commits, no fixup commits. It is not behind
main(HEAD..origin/mainis empty). gh pr checksreports no checks for this branch, so CI has to run before merge.
CI
gh pr checks reports no checks for this branch.
I ran locally: go test -count=1 -p 4 ./internal/provider/ -run 'TestDeclinedActivityEndsDeclined|TestEventProjection|TestFailedActivity' passed. Not run locally: the Node run-loop.test.ts (dependencies are not installed in this worktree). I reviewed its logic by reading the code instead.
Automated review by Claude Code
Automated review of 8cff7f6 by Claude Code.
Codex ends a fileChange or commandExecution item with status "declined" when it refuses the step, for example a patch the permission review denied, or a command whose approval request the Daemon declined. The Daemon passed that status on, but the Activity projection only knew failures, so a refused patch finished as "succeeded" in the Room, as if the edit had been made. Before this change a declined teamhub message send finished as succeeded too, so the Agent Service counted it as a delivered message. End a declined step's Activity with the contract's "declined" outcome, which Web's step details already label. Its output stays private. Verified: TestDeclinedActivityEndsDeclined fails without the fix and passes with it; the other provider tests, make check-computer-go, lint-go-daemon and the repository gate pass. Not run against a live Codex.
8cff7f6 to
e75c51c
Compare
|
Rebased onto 7fb84e9 to resolve the conflict with it. That commit makes a Run whose message writes were neither delivered nor failed count as What's left is the Daemon side: a step Codex declined now ends |
There was a problem hiding this comment.
Approve with nits (1 P2)
Scope: follow-up on 8cff7f6. Base main, merge-base 7fb84e97, 1 commit, 2 files reviewed. Loaded coderbook; ponytail-review and karpathy-guidelines were not loaded, and their checks were applied from the review checklist. Ran in a separate session.
The PR was rebased onto 7fb84e97 since the previous review. git range-diff shows the ReplyDelivery change, its run-loop test and the apps/node-services/src/agent/AGENTS.md edit are gone. The Daemon projection change and its test did not change.
Previous findings
- The previous review had no findings.
Findings
P2
- The PR description claims a test change the diff doesn't contain. See
apps/node-services/tests/agent/executor/run-loop.test.ts:516. The body says: "I took main's run-loop case in which a Human who mentioned the Agent waits and the only write endscanceled, and changed that outcome todeclined: the Run still endsreply_not_sent." The diff touches onlyevent_projection.goandevents_regression_test.go, and line 516 still usesmessageWrite("send-1", "canceled"). The behaviour itself is still covered at the unit level by main'sreply-delivery.test.ts:93(it.each([undefined, "canceled", "declined"])), so no behaviour is left untested. Fix: add the run-loop change, or remove the sentence from the description.
Verified as fine
- Codex passes
declinedthrough unchanged.codexStatusmaps onlyinProgress(internal/provider/native/codex_events.go:426-431).commandExecutionkeepsdeclinedunless the exit code is non-zero (codex_events.go:369-377). A declined command has no exit code.fileChangeemitsStatus: statuswithOutput: "declined: N file changes"(codex_events.go:383-385), which matches the test fixture. declinedtakes precedence overis_error.is_erroris true only forfailed,errorandcancelled(internal/provider/executor.go:769), so the two cases in the newswitch(event_projection.go:160-167) can't both match.- Output stays private. Content is attached only for
outcome == "failed"or a Task-creation receipt (event_projection.go:172-182). A declined patch never publishes its summary. A declinedteamhub task createcommand has no aggregated output, so it publishes nothing either. - The contract already allows
declined.AgentRuntimeActivityOutcomelists it (contracts/openapi/components/agent-runtime-state.yaml:1285), and the Agent Service'sRunActivityOutcomeincludes it (apps/node-services/src/agent/executor/provider.ts:225). No contract regeneration is needed. - The reply-tracking effect matches the description.
ReplyDeliverycounts onlysucceededandfailed(apps/node-services/src/agent/executor/reply-delivery.ts:35-38). A declined send therefore no longer counts as delivered, and it is treated as neither delivered nor failed, as the body says. - Language check: no CJK in the added lines or in the commit message.
Process notes
- The branch is 9 commits behind
main.mainrequires up-to-date branches, so it needs a rebase. - There are no merge commits or fixup commits.
CI
gh pr checksreports no checks on this branch, so CI has not run on this head and needs to before merge.- I ran this locally:
go test -count=1 -p 4 -run 'TestDeclinedActivityEndsDeclined|TestEventProjection|TestFailedActivity' ./internal/provider/passes. - No
-racerun was needed, since the change has no concurrency.
Automated review by Claude Code
Automated review of e75c51c by Claude Code.
|
Re the bot's P2: that run-loop check was a local edit against 7fb84e9, not part of this diff. I reworded the description to say so. I didn't add that run-loop change as a test, since main's |
There was a problem hiding this comment.
Approve (0 findings)
Scope: follow-up on e75c51c (the head is unchanged since the previous review). Base main, merge base 7fb84e97; 1 commit, 2 files reviewed. Helper skills: coderbook loaded; ponytail-review and karpathy-guidelines were not loaded, and their checklists were applied from the review instructions instead. Ran in a separate session.
Previous findings
- Resolved: the PR body claimed a run-loop test change that is not in the diff (
apps/node-services/tests/agent/executor/run-loop.test.ts:516). The body now says it was "a local edit that is not part of this PR", made only to check what the Agent Service does. So the description no longer claims the change, and the code needs no update.
Findings
None.
Verified as fine
- Status reaches the projection. For
fileChangeandcommandExecution,codexStatuspassesdeclinedthrough unchanged (native/codex_events.go:426-431). A declined command has no exit code, so theExitCode != 0 → failedoverride does not apply (codex_events.go:370-372). - Ordering. The
declinedcheck runs before theis_errorcheck (event_projection.go:160-166). Inexecutor.go:769,is_erroris computed only fromfailed/error/cancelled, so the two cases never overlap. - Output stays private. A declined step gets no content: the label is set only for
failed, or when there is a task receipt (event_projection.go:171-176). The test checkscontent == nilfor both shapes. - Contract.
declinedis already in the outcome enum (contracts/openapi/components/agent-runtime-state.yaml:1285) and in the TypeScript provider type (apps/node-services/src/agent/executor/provider.ts:225). No regeneration is needed. - Agent Service.
ReplyDeliverycounts onlysucceededas delivered andfailedas failed (reply-delivery.ts:30-40). A declined write is therefore neither, which matches thereplyNotSentbehaviour the PR body describes. - Size of the fix. The change is minimal and targets the root cause, in the one place the outcome is decided. The new test fails without the fix (per the body), and the shape of its assertions matches the projection code.
- Conventions. No CJK in the added lines or the commit message. The new comment explains why. No merge commits.
Process notes
- The branch is 27 commits behind
main, andmainrequires up-to-date branches, so it needs a rebase. gh pr checksreports no checks on this branch, so CI has to be triggered.
CI
No checks were reported for the PR branch. I ran go test -count=1 -p 4 -run 'TestDeclinedActivityEndsDeclined|TestEventProjection|TestFailedActivity' ./internal/provider/ myself, and it passed. The change touches no concurrency, so I did not run it with -race.
Automated review by Claude Code
Automated review of e75c51c by Claude Code.
What and why
Codex ends a
fileChangeorcommandExecutionitem with statusdeclined(
CommandExecutionStatus,PatchApplyStatus;links are to Codex 0.166.0, the Daemon's minimum) when it refuses the step:
through the PermissionRequest hook, ends
Declined(
events.rs);answerServerCalldoesso while permission review is on) ends
Declinedwith no exit code and nooutput
(
bespoke_event_handling.rs,completion item).
The Daemon passed the status on, but the Activity projection only treated
failed,errorandcancelledas failures, so both finished their Activity assucceeded: the Room showed a refused edit as done.The Runner Gateway contract already has a
declinedoutcome foractivity.finished, and Web's step details label it ("Declined"), but nothingproduced it. A declined step now ends its Activity with outcome
declined. Itsoutput stays private; for these two shapes there is no reason text to show (the
patch output is the Daemon's own
declined: N file changes).tool.returnedisunchanged.
Reply tracking
Before this change, a
teamhub message sendwhose approval request wasdeclined also finished
succeeded, so the Agent Service counted it as adelivered message, and a Room Run whose only send was refused ended
succeededwith no reply in the Room.ReplyDeliverycounts adeclinedwrite as neither delivered nor failed. Since 7fb84e9 ("separate silent room
exits from reply_undelivered"), a Run whose writes were neither delivered nor
failed counts as
replyNotSentwhile a Human who mentioned the Agent waits,and main's
reply-delivery.test.tspins that for a declined write, so this PRadds no Agent Service test. With this change such a send arrives as
declined. To see what the Agent Service then does, I made a local edit thatis not part of this PR: in main's run-loop case in which a Human who mentioned
the Agent waits and the only write ends
canceled, I changed that outcome todeclined, and the Run still endsreply_not_sent.An earlier version of this PR also changed
ReplyDeliveryto count a declinedwrite or read as failed (a write then ended the Run
reply_undelivered).7fb84e9 decided the other way and conflicted with it, so I rebased onto it and
dropped that part; this PR now changes only the Daemon's projection.
How it was verified
TestDeclinedActivityEndsDeclined(a declined patch with the Daemon's summary output and a declined command with
no output both end
declinedwith no content) fails on main (7fb84e9) andpasses with the fix; the other provider tests pass.
make check-computer-go,make -C apps/teamhub lint-go-daemon BASE=7fb84e97and
make check-repository-gate BASE=7fb84e97.make check BASE=7fb84e97on this branch alone fails only in
go-local-daemon-process.test.ts(9 of 11cases), as on main since b004fee raised the Codex minimum; test(teamhub): give the process fixture's Codex a version the Daemon accepts #646 fixes that
file. Merged onto 7fb84e9 with test(teamhub): give the process fixture's Codex a version the Daemon accepts #646 and my other open PRs,
make checkpasses.
contracts/openapi/changed (not touched; theoutcome is already in the contract)
Not run against a live Codex; the item shapes come from the Codex sources linked
above.
Boundary
A command the PermissionRequest hook denies produces no item in this Codex: the
refusal happens before the command starts, so it gets no Activity, as before.
Web's compact activity view still treats a declined message-only group like a
successful one and hides it (
isSuccessfulMessageOnlyGroupchecks forfailed),and a Task row does not mark a declined
teamhub task createas failed, as onmain; that is left to a Web change. No docs change: the Computer docs do notlist Activity outcomes, and the contract already has
declined. No effect onthe user message →
provider_readypath.🤖 Generated with Claude Code