Skip to content

fix: show preflight failures when compaction auth is unavailable - #150400

Merged
shakkernerd merged 1 commit into
mainfrom
fix/compaction-auth-failure
Sep 17, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/compaction-auth-failure

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

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:

Baseline failure Evidence and separate repair
Three PR-tooling shards cannot load a copied plugin-discovery dependency. The shared wrapper inventory omits 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 Control UI exceeds its existing startup-JS budget. Baseline Node 24.20.0 / Vite 8.2.2 / Pako 3.0.1 produced the identical 362,706 B gzip result against the 362,588 B limit. The changed compaction modules are absent from all 333 emitted source maps. #150420 owns an active size reduction.

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.

@shakkernerd
shakkernerd requested a review from a team as a code owner September 17, 2026 00:21
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 9:40 PM ET / September 17, 2026, 01:40 UTC (Revision 2).

ClawSweeper review

What this changes

The 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
Reviewed head: 6b8c966b61e0f797650cdda37ca82e711c7328fc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused correction with meaningful regression coverage, reported broader validation and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The member-authored PR is exempt from the external contributor proof gate. Its synthetic public-entry-point tests exercise auth-planning refusal, but do not establish live channel delivery; the body explicitly acknowledges that limit.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-authored PR is exempt from the external contributor proof gate. Its synthetic public-entry-point tests exercise auth-planning refusal, but do not establish live channel delivery; the body explicitly acknowledges that limit.
Evidence reviewed 9 items Current main still needs the correction: The merge-base-to-fetched-main comparison is empty for all three changed production modules; current main retains the uncaught preparation path.
Bounded failure normalization: Both synchronous auth-planning passes return explicit failures while abort errors remain exceptions. Store loading, harness selection and convergence remain outside the catch. This is OpenClaw-owned planning; the correction does not depend on a Codex runtime or protocol contract.
Cancellation and owner checks precede the result: Queued compaction rechecks its abort signal and host authority immediately after preparation, before returning the normalized failure or proceeding toward model execution.
Findings None None.
Security None None.

How this fits together

Before 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +41, Tests +110. Total +151 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 80 39 +41
Tests 2 110 0 +110
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 190 39 +151

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #150388
Summary: This PR is the implementation candidate for the reported compaction auth-preparation failure.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best 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.

Labels

Label justifications:

  • P1: The source-confirmed failure can leave required-compaction channel inputs unanswered despite a healthy ordinary reply model.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The member-authored PR is exempt from the external contributor proof gate. Its synthetic public-entry-point tests exercise auth-planning refusal, but do not establish live channel delivery; the body explicitly acknowledges that limit.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-17T00:25:54.768Z sha 6b8c966 :: needs maintainer review before merge. :: none

@shakkernerd shakkernerd self-assigned this Sep 17, 2026
@shakkernerd
shakkernerd merged commit 1fbb415 into main Sep 17, 2026
218 of 223 checks passed
@shakkernerd
shakkernerd deleted the fix/compaction-auth-failure branch September 17, 2026 01:42
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: authentication planning errors during compaction now produce the existing preflight recovery reply.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…nclaw#150400)

Report compaction authentication failures through the existing preflight recovery reply while preserving explicit model selection, cooldowns, and cancellation.

Refs openclaw#150388.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: channel messages stay unanswered when compaction auth preparation fails

1 participant