Repository navigation
Conversation
… own report is never read as inherited The status rule cannot tell an attempt's own report from an inherited one when a failure turned a reactivated reported row interrupted and another backend's report turned it back. The row now carries the attempt that wrote its report (taskReportAttemptId, written with reportedAt), and the ledger counts a report that names the attempt as its own on top of the status rule. A binding can only add a refusal. Load drops a malformed value.
Write the binding unconditionally (an absent attempt id writes undefined), and check the row's attempt id and its binding with one predicate before the load heal.
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. |
|
@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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
🟢 e2e stories (Haiku): 14 passed22 agent steps · 7 replayed from cache · 15 model calls · 47.3k tokens (27% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 24s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 7.9k tokens (32% cached) All 3 tests in 3 files
e2e 0.20.0 · 24.4s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 8.1s · 2 targets (web, phone) · run artifacts |
|
Codex Review: Didn't find any major issues. Chef's kiss. 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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Summary
A task row now records which attempt wrote its report, and the stream-end decision counts a report that names the attempt as the attempt's own. Before, one sequence on two backends let a held follow-up run as a new turn of a reported attempt. This closes the limit named on
InheritedReportin #8067.Background
#8067 tells an attempt's own report from an inherited one by the row's status. Only a row that read
interruptedcould be reported again, so a report that turned itreportedwas the attempt's own. Areportedrow's report was treated as inherited for good.That fails in one sequence:
reported.interruptedand keeps its report time (failAgentTaskTerminallyhas no completed-report guard).finalizeAgentTaskReportends early only on areportedrow, so it writesreported.reportedagain, the same as when F began. The decision resolvesnonreport, and a held follow-up runs as a new turn of a reported attempt.The row said that a report exists, never whose it is.
Implementation
taskReportAttemptIdon the workspace row (server-owned, a bare attempt id). Not part ofWorkspaceMetadata.reportedAt,publishAgentTaskReportandadoptPersistedReport, write the row'staskAttemptIdinto it in the same config edit. A superseded or retired report returns before the write, so it writes none. A row without an attempt id gets none.StreamEndLedger.rowReportsAttemptkeeps the status rule and adds one clause:statusRule || row.taskReportAttemptId === attemptId. A binding can only add a refusal. It never turns a case the status rule refuses into one it allows, so the same-millisecond case that 🤖 fix: tell an attempt's own report from an inherited one by the row's status #8067 pinned staysindeterminatewhatever the binding says. The second reader,resolveDecisionOfReportedAttempt, gets the added case and nothing else.normalizePersistedWorkspacedrops a value that is not an attempt id (hand edit, corruption). A dropped value reads as absent.config/index.tskeeps the field, liketaskTerminalFailure.Validation
taskService.reportDecisionHold.test.ts) hold the stream-end handler on the workspace event lock, change the row meanwhile, and let a secondTaskServiceon the same config report. The failure is a raw row edit, becausefailAgentTaskTerminallyon the owning backend also closes the attempt's admission, which is a different refusal. Two sequences end in a held follow-up with reasonindeterminateand one stream: reported row, failure, then another backend's report. And interrupted row, another backend's report, then a failure. A control with a binding that names the predecessor still runs the follow-up. A superseded report writes no binding.streamEndLedger.test.ts): binding variants (names the attempt, names another attempt, absent) of the inherited-report and replaced-report cases, including the same-millisecond case, plus four cases in which a binding that names the attempt turns the decisionindeterminate.taskService.agentReports.waits.test.ts): adoption writes the binding, and writes none for a row without an attempt id.config.test.ts): the field survives reload and a metadata write, and a malformed value is dropped at load.Risks
Behavior changes only in the sequence above, and only toward a refusal: the held follow-up is kept as held input instead of running, the same outcome as any other unconfirmed attempt.
Downgrade and mixed builds are safe, and the change is additive. A build without this change ignores the field and may drop it in a metadata round trip, which makes the row an old row. Such a build falls back to today's status rule: the reported-then-failed-then-reported sequence above is then refused as little as it is on main today. If that build reports after a new build wrote the field, the field names an earlier attempt, adds nothing, and the status rule applies as before. A stale value can only name an attempt that did write a report, so it cannot cause a wrong refusal.
I merged main (#8076 and later) into this branch. The merge had no conflicts. The gap tests use the event lock, not the plan-like probe, so they hold with #8076's probe change.
Generated with
xum• Model:anthropic:claude-sonnet-5-5• Thinking:xhigh• Cost:$56.01