fix(handover): keep the launch's warnings when a handover fails after its respawn #4224
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 643 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.387
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #4224"
general
weight: 0.35
mvschwarz
The problem
When a seat handover can't read the seat's previous environment marker (#3915), it warns that dropped environment keys may remain. The respawn can also warn that a key couldn't be reconciled. A successful handover reports those warnings. A handover that failed after its respawn dropped them, in any of these cases:
A failed handover is exactly where an operator looks. CodeRabbit found this in its review of #3915.
What changes
- It follows the path #3253's process-limit notice already takes.
- in its
successor_create_failedresult;- when the delivery fails after a successful launch, for either the fresh restore packet or the rebuild priming;
- on every finalization failure after a successful launch, such as the successor's session being gone or a failed commit.
rig seat handoverprints them asWarning:lines beside the failure, and so doesrig seat handover --recoverwhen a recovery fails. With--json, they're in the result aswarnings, with noWarning:lines.How it was checked
main: one case per layer, beside #3253's process-limit cases.- The launcher's readiness failure after an unreadable marker.
- The service's readiness and launch failures.
- The CLI's plain output.
- All four fail without the change.
- Four service cases, each a successful launch with a respawn warning, followed by a failure:
- the fresh packet's delivery;
- the rebuild priming's delivery;
- continuity (the successor's session gone);
- the commit.
- Red at the first commit: all four fail, each only on the missing
warnings.- Two CLI cases for a delivery failure: the plain output prints the warning, and
--jsoncarries it in the result with noWarning:line. They pass before this change too, since the CLI already prints whatever warnings a failure carries. They pin that output.- A CLI case: a failed
--recoverwith one warning prints exactly oneWarning:line, and with--jsonit parses to the unchanged result with noWarning:line. Red at the second commit: the plain output printed none.- A service case:
- Setup: the failed handover's launch raises a warning. The recovery finds the successor's current conversation unread, and its commit fails.
- Checks: the failure carries the recovery's own warning, and not the earlier attempt's.
- When it fails: it passes at the second commit, which already carries the warnings. It fails with the second commit's service change set aside, only on the missing warning.
- A type change: the recovery result's failure variant declares the optional
warnings.- Three cases, each a handover with a retired openrig-core copy that fails at one point: readiness, the fresh packet's delivery, or the rebuild priming's delivery.
- Red at the third commit: all three carried only the launch's warning.
- Green: each carries the copy note before it.
- daemon: 19 files (every test that names the handover service, the successor launcher or these failure codes), 616 passed, 3 skipped, 5 todo. The two skipped files are gated end-to-end tests.
- CLI: 2 files, 164 passed;
- both builds and
npm run lintpassed.🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Handover and recovery failures now retain relevant warnings from session launch and recovery steps.
* In human-readable output, the CLI displays warnings alongside failure messages. JSON output includes warnings without separate warning lines.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->