Repository navigation
fix: show preflight failures when compaction auth is unavailable - #150400
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 9:40 PM ET / September 17, 2026, 01:40 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR converts compaction authentication-planning failures into unsuccessful results so required preflight can show its existing recovery reply, with coverage for queued and direct compaction. Merge readiness✅ Ready for maintainer review This remains a useful fix for a source-confirmed failure on current main. No actionable patch defects were found, consistent with the previous review of the same head. Priority: P1 Review scores
Verification
How this fits togetherBefore answering a message, OpenClaw may compact conversation history to fit the model’s context window. Compaction prepares authentication for the selected summary model, and required preflight turns an unsuccessful result into a recovery reply. flowchart TD
A[Incoming message] --> B[Required preflight]
B --> C[Compaction auth preparation]
C --> D{Authentication available?}
D -->|Yes| E[Run compaction]
D -->|No| F[Unsuccessful result]
F --> G[Existing recovery reply]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +41, Tests +110. Total +151 across 5 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep failure normalization in shared compaction preparation while preserving explicit model selection, credential eligibility, cancellation and existing recovery replies. Do we have a high-confidence way to reproduce the issue? Yes, from source and the supplied synthetic reproduction: a sole cooled profile for an explicit summary model causes queued preparation to reject before preflight can classify the failure. This read-only review did not execute tests. Is this the best way to solve the issue? Yes. The patch repairs the producer’s result contract and updates both callers without changing authentication policy or duplicating the existing reply formatter. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 388584f9d9f2. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Fixed: authentication planning errors during compaction now produce the existing preflight recovery reply. |
…nclaw#150400) Report compaction authentication failures through the existing preflight recovery reply while preserving explicit model selection, cooldowns, and cancellation. Refs openclaw#150388.
Fixes #150388
What Problem This Solves
Channel messages that require compaction can remain unanswered when the compactor's authentication is temporarily unavailable. Auth planning throws before queued compaction reaches its normal execution failure handling. Required preflight expects an unsuccessful compaction result, so the raw exception bypasses its existing actionable failure reply and reaches channel retry handling instead.
The synthetic reproduction uses an explicit summary model with one cooled-down profile and a different ordinary session model. Queued compaction rejects before credential resolution or a summary request. The direct public compaction entry point is a passing control because its outer coordinator already translates the failure.
User Impact
Required preflight can now report its existing compaction failure message, including the options to try again, use
/compact, or start a new session with/new. This lets the channel finish failure handling without repeatedly retrying the same unclassified preparation exception.The explicit compaction model and its credential order and cooldown eligibility are preserved. Cancellation and lost session authority still take precedence over returning an ordinary failure. There are no configuration, schema, persistence, permission, or release changes.
Why This Change Was Made
The shared compaction helper now returns an explicit failure result for its two auth-planning passes. The catch is limited to auth planning: credential-store loading, harness selection, harness convergence, and metadata resolution retain their existing exception behavior. Cancellation exceptions also remain exceptions.
Both callers consume that result. Queued compaction revalidates its owner immediately after the await and then returns the existing unsuccessful-compaction shape. Direct preparation uses its existing diagnostic formatter, preserving the original error and failure metadata needed by the existing fallback classifier. Successful preparation retains the complete ordered auth-attempt set.
Evidence
On unmodified source
2a5cacd22a82fb1b9190475d00bf58f0c05ead78, the synthetic queued case rejected with the plain cooldown error while the direct compaction control returned an unsuccessful result. The corrected tests exercise the real auth planner through both public compaction entry points, preserving the explicit target and cooldown state without resolving credentials or sending a model request.371 tests passed on
6b8c966b61e0f797650cdda37ca82e711c7328fc: 207 compaction/model-resolution tests, 152 reply and ingress-retry tests, and 12 failure-formatting tests. They cover the new refusal path and existing fallback, cancellation, authority, preflight recovery, disclosure, and delivery-marking contracts. The complete changed-path gate also passed all 31 selected steps, including production/test types, type-aware lint, and repository guards. Independent source review and autoreview found no actionable findings. ClawSweeper's completed review rated this exact head Platinum.Hosted CI failed on two independent baseline defects, both reproduced on unmodified
387f69830a81968ed2d4ef830d67456167bc7f43:discovery-availability.ts. The same module-loading failure reproduced in existing baseline cases; the main-refresh failures use that same copier and fail before worktree setup. #150453 owns the inventory repair.The aggregate CI gate reports those failures. The compaction patch changes neither failing input set, and the separate repairs are not prerequisites for this failure-handling correction. No live channel or provider execution is claimed.