Skip to content

fix(dispatch): preserve pre-existing last_error on annotation failure (#10087) - #10792

Merged
dezren39 merged 1 commit into
mainfrom
queue/17494-10087-dispatch-lasterror
Nov 16, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/17494-10087-dispatch-lasterror

Conversation

@dezren39

@dezren39 dezren39 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Follow-on from triage task 16966 (lane code-d) on issue #10087 — PR #4231 residual.

Problem: in launchSession, the lane-ledger catch PATCHes a failure note onto the task last_error (server.ts), then annotateLaunch noteFailure PATCHed last_error from a fresh local array via the field-set patchTask — overwriting the lane note. Final last_error named only the annotation failure.

Fix (pm-stack/dispatch/src/launch_annotations.ts): annotateLaunch now reads the task existing last_error lazily on the first annotation failure (no extra GET on the happy path) and prepends it, so the final note names both failures. Optional getTask? on LaunchAnnotationQueue keeps older stubs compatible; a missing reader or failed read degrades to the previous behavior. No launch-behavior change: annotations and lane ledger stay best-effort, launch never rejected, wait:true warnings shape unchanged.

Tests: 4 new regression cases in test/launch_annotations.test.ts (pre-existing + failing comment, pre-existing + both failing, failed read, no-read on happy path). bun test test/launch_annotations.test.ts: 9 pass / 0 fail. Full bun test: 214 pass, 2 fail — both test/github.test.ts response-shape timeouts, proven pre-existing on clean main (fail identically with this change stashed).

Closes #10087.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…#10087)

annotateLaunch's noteFailure PATCHed last_error from a fresh local
array, overwriting a lane-ledger note recorded earlier in the same
launch. Read the task's existing last_error lazily on the first
failure (no extra GET on the happy path) and prepend it, so the
final note names both failures. A missing reader or failed read
degrades to the previous behavior; the launch stays best-effort.

Regression tests: pre-existing note + failing comment, pre-existing
+ both failing, failed read, and no-read on the happy path.
@dezren39
dezren39 requested a review from a team as a code owner November 16, 2026 14:54
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T14:54:59.962340Z
We couldn’t complete this review. Comment @codex review to try again.
92ccc49 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c5a0bed7-b5d1-4d9a-80a7-fee02482fe23
Commits

Reviewing files that changed from the base of the PR and between bd25dc9 and 92ccc49.

Files selected for processing: 2

  • pm-stack/dispatch/src/launch_annotations.ts
  • pm-stack/dispatch/test/launch_annotations.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 merged commit e6a8cd2 into main Nov 16, 2026
1 check passed
@dezren39
dezren39 deleted the queue/17494-10087-dispatch-lasterror branch November 16, 2026 15:31
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.

dispatch: an annotation failure note overwrites the lane-ledger failure on the task's last_error (PR #4231 residual)

1 participant