Skip to content

fix: native conversations fail when compaction uses a fallback model - #183282

Merged
steipete merged 3 commits into
openclaw:mainfrom
pstarkgit:fix/compaction-fallback-harness
Oct 26, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
pstarkgit:fix/compaction-fallback-harness

Conversation

@pstarkgit

@pstarkgit pstarkgit commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #183273

What Problem This Solves

Fixes: long native-runtime conversations stop replying when compaction's configured fallback model cannot run through the primary conversation's harness.

User Impact

Unlocked sessions can use their configured fallback to persist a summary and continue with recent history intact. Locked sessions continue refusing cross-model fallback. This restores existing fallback behavior; it does not add native compaction to runtimes that lack it.

Why This Change Was Made

Fallback preparation and execution retained the primary harness after discarding its model and authentication plans. Each actual fallback now resolves its own runtime and required plugin; the primary attempt retains its binding. No settings or storage contracts change.

Production +2/-2 (net 0); tests +121/-8 (net +113). The two regression cases exercise successful native-to-built-in fallback and locked-session refusal through the real compaction owner, local HTTP transport, and SQLite transcript. Thanks to @pstarkgit for the fix and reproduction.

Evidence

  • Independently reproduced the unlocked regression on the unchanged main implementation: the primary HTTP 401 leads to Requested agent harness "summary-native" does not support backup/fallback-model. The locked-session control passes.
  • Candidate summary/fallback, hooks, and authentication suites pass all 103 tests: 224.52 seconds in Vitest, 444.10 seconds including cold worker preparation. The production-boundary fixture deliberately pays for plugin loading, HTTP transport, and persistent history; a mocked planner would not prove fallback execution or summary persistence.
  • Integrated main ee6efea4f8c5 without conflicts. The integrated local rerun collected no tests because the shared worktree installation could not resolve quickjs-wasi during compiled-worker preparation; exact-head PR CI supplies the integrated proof.
  • Targeted type-aware oxlint, oxfmt, and diff checks pass. Independent diff-scoped autoreview through P2 found no actionable findings.
  • Contributor-reported live proof used an isolated built Gateway with a real native conversation and an on-device fallback. Automatic compaction encountered primary authentication failure, persisted one fallback summary, and the resumed native reply recalled both synthetic facts. The Gateway was stopped afterward. This lane did not repeat that live run because it would require native-provider setup; it repeated the production-boundary regression locally. Live OpenAI fallback was not tested.

@clawsweeper

clawsweeper Bot commented Oct 25, 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.

@pstarkgit
pstarkgit marked this pull request as ready for review October 25, 2026 05:19
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Oct 25, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Compaction fallback models resolve their own runtime and plugins instead of inheriting the primary conversation’s harness.

Example: An unlocked native conversation needs compaction; fixture/model returns HTTP 401 and backup/fallback-model is configured.

  • Before: The fallback inherits summary-native and is rejected before summarization.
  • After: The fallback uses its eligible runtime, persists a summary, and preserves recent conversation history.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A minimal repair with reusable Gateway proof, meaningful production-boundary regressions, and no actionable findings; exact-head CI remains in progress.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): Reuse the earlier accepted isolated built-Gateway proof: primary authentication failure led to an on-device fallback summary and a resumed native reply retaining both synthetic facts; the integration leaves the exercised production repair unchanged.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Long native conversations stop replying when the primary harness rejects a healthy configured summary fallback.
Reason: The change restores documented fallback behavior through existing runtime owners without adding settings or altering the session’s selected model.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary: current main retains the incompatible primary-harness binding, and the focused repair has no actionable review findings.

Priority: P1
Reviewed head: 55cdd1aea451d2584ea3cf26409f0702afe48863

Before merge

None.

Findings

None.

Agent review details

How this fits together

The compaction coordinator receives session identity and configured model candidates, prepares runtime resources, and returns a persisted summary result to the conversation runner.

flowchart TD
  A[Conversation preflight] --> B[Compaction coordinator]
  B --> C[Primary summary attempt]
  C --> D[Configured fallback chain]
  D --> E[Candidate runtime and credentials]
  E --> F[Persist summary]
  F --> G[Resume conversation]
Loading

Technical review

Best possible solution:

Use existing candidate-selection owners for fallback runtimes while preserving primary bindings, locked-session restrictions, and transcript ownership.

Do we have a high-confidence way to reproduce the issue?

Current-main source traces the inherited harness into unsupported-model rejection, and the reported HTTP-401 regression targets that path; this read-only review ran no target code.

Is this the best way to solve the issue?

The two production edits are the smallest complete repair because planning and execution must both release the inherited binding for actual fallback candidates.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 952ea71f730d.

Provenance checked

  • Fallback plugin runtime binding changes intended behavior with a stated reason (6c9b388: Root-owned installation prepared selected harness plugins before execution; subsequent admission work preserved that propagation.)
  • Fallback attempt runtime and authentication plans changes intended behavior with a stated reason (3b627ad: Retain issued compaction resources while rebuilding non-primary runtime/auth plans and preserving existing routing.)
  • Existing fallback planner assertion changes intended behavior with a stated reason (f2fccfa: Consolidate lower-value test coverage while retaining owning-boundary cases.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 3b627ad adds src/agents/embedded-agent-runner/compact.ts:541 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3b627adf6c6a; files: src/agents/embedded-agent-runner/compact.ts)
  • Josh Lehman: Raw commit 388614d adds src/agents/embedded-agent-runner/compact.ts:395 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 388614d8960e; files: src/agents/embedded-agent-runner/compact.ts)

PR surface

Source 0, Tests +113. Total +113 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 2 0
Tests 2 121 8 +113
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 123 10 +113

Review metrics

Metric Value Why it matters
Production versus test changes Production +2/-2; tests +121/-8 The minimal production repair is supported by distinct unlocked recovery and locked refusal cases using real transport and persistence.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: Long conversations can repeatedly fail before replying despite a healthy configured fallback.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-25T05:35:57.016Z sha c12d17b :: needs real behavior proof before merge. :: [P2] Update the existing fallback planner regression
  • reviewed 2026-10-25T06:23:05.121Z sha 769638c :: needs maintainer review before merge. :: none

Reviewed October 25, 2026, 7:19 PM ET / 23:19 UTC (Revision 3).

@pstarkgit

Copy link
Copy Markdown
Contributor Author

Fixed the obsolete fallback planner assertion and reran the full affected hooks suite (87 passing) plus summary/authentication regressions (16 passing). Added live isolated Gateway proof to the PR description: real Muse conversation, automatic compaction authentication failure, real on-device fallback summary persisted, then successful Muse reply recalling the retained facts. No operator service or personal configuration changed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 25, 2026
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 25, 2026
@steipete
steipete merged commit 24d7dd3 into openclaw:main Oct 26, 2026
135 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
…penclaw#183282)

Let each actual compaction fallback resolve its own harness after discarding the primary model and authentication plans. This restores native-conversation fallback while preserving locked-session behavior.

The unlocked regression fails on the base with an unsupported primary harness; the locked control passes. The candidate's compaction, hook, and authentication coverage passes 103 tests, and exact-head CI passes.

Closes openclaw#183273

Co-authored-by: pstarkgit <[email protected]>
RomneyDa pushed a commit that referenced this pull request Oct 26, 2026
…183282)

Let each actual compaction fallback resolve its own harness after discarding the primary model and authentication plans. This restores native-conversation fallback while preserving locked-session behavior.

The unlocked regression fails on the base with an unsupported primary harness; the locked control passes. The candidate's compaction, hook, and authentication coverage passes 103 tests, and exact-head CI passes.

Closes #183273

Co-authored-by: pstarkgit <[email protected]>
Release adaptation: ported the locked/unlocked native-harness fallback regression into the stable compact.summary-fallback.test.ts withSession layout (main restructured the file around createFixture), added the auth-error summary mode, and kept the stable hooks-test shape while asserting the fallback candidate carries no runtime pin. Production change is unchanged.

(cherry picked from commit 24d7dd3)
RomneyDa pushed a commit that referenced this pull request Oct 26, 2026
…183282)

Let each actual compaction fallback resolve its own harness after discarding the primary model and authentication plans. This restores native-conversation fallback while preserving locked-session behavior.

The unlocked regression fails on the base with an unsupported primary harness; the locked control passes. The candidate's compaction, hook, and authentication coverage passes 103 tests, and exact-head CI passes.

Closes #183273

Co-authored-by: pstarkgit <[email protected]>

(cherry picked from commit 24d7dd3)

Adapted for 2026.9.x: 9.x has no compact.summary-fallback.test.ts, so the regression lands in a new trimmed file carrying only the auth-error provider fixture and the locked/unlocked native-harness case, registered in the forked database-worker lane (9.x direct compaction needs the host-owned SQLite broker). The 9.x hooks test expectations for both fallback-planning cases (manifest-normalized and alias) now assert fallbacks carry no primary runtime while compaction.model keeps it.
RomneyDa added a commit that referenced this pull request Oct 26, 2026
Move the #180308 MCP inspection redaction case into mcp-cli.redaction.test.ts (registered in the database-worker lane) and tighten the #179538 state-directory cases so both files stay under the 1000-line limit. Rename the #181056 Slack reconnect-loop fixture variables that shadowed per-test locals, and drop an await of the synchronous 9.x plugin registry loader in the #183282 compaction test.
tideclaw-bot added a commit that referenced this pull request Nov 4, 2026
Adapt 28 audited units to the release-native ownership model.
Preserve AgentsAPI/cron policy and actor-owned projection recovery.

Source provenance and original contributor credit:
#176852 342fea1 — yinx65588-boop <[email protected]>
#180853 50f795a — Peter Steinberger <[email protected]>
#184041 e356196 — Peter Steinberger <[email protected]>
#184069 7739767 — Peter Steinberger <[email protected]>
#182666 9ff9d88 — Stefan Stüben <[email protected]>
#183884 112667f — Peter Steinberger <[email protected]>
#184021 05010ed — Peter Steinberger <[email protected]>
#183390 15a5706 — Masato Hoshino <[email protected]>
#183282 24d7dd3 — pstarkgit <[email protected]>
#164843 127f3c2 — PollyBot13 <[email protected]>
#172959 30f88d3 — main object unavailable; stable source inspected
#172959 eb2255b — johan-eilertsen <[email protected]>
#120943 1a76be1 — Peter Steinberger <[email protected]>
#178271 b3c8f8a — Wang Rui <[email protected]>
#178271 7bd6895 — RJ <[email protected]>
#177518 679980c — Masato Hoshino <[email protected]>
#182454 a538efe — Peter Steinberger <[email protected]>
#180042 bef193c — sunlit-deng <[email protected]>
#179347 2405bf4 — Peter Steinberger <[email protected]>
#179060 ccedbdc — Peter Steinberger <[email protected]>
#118011 9596527 — Peter Steinberger <[email protected]>
#182219 fade14f — Sukhdeep <[email protected]>
#181871 b1b5f00 — Peter Steinberger <[email protected]>
#178888 5125e3c — RoboClaw <[email protected]>
#180075 c9c2d16 — Wang Rui <[email protected]>
#181081 f223f77 — Jason O'Neal <[email protected]>
#180236 d11c239 — Dallin Romney <[email protected]>
#173921 af50fbd — Peter Steinberger <[email protected]>
#174868 7034ca4 — Peter Steinberger <[email protected]>
#172724 492c932 — Dallin Romney <[email protected]>

Proof: targeted owner/sibling tests, supported fresh two-pass review clean.
Known qualification gaps recorded in the release backport evidence.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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.

Compaction fallback inherits the primary native harness and rejects its model

2 participants