Skip to content

feat(memory): let operators name memory-flush fallbacks - #138144

Closed
zijunl wants to merge 3 commits into
openclaw:mainfrom
zijunl:feat/memory-flush-fallbacks
Closed

zijunl wants to merge 3 commits into
openclaw:mainfrom
zijunl:feat/memory-flush-fallbacks

Conversation

@zijunl

@zijunl zijunl commented Sep 4, 2026 •

Copy link
Copy Markdown

Implements the shape proposed in #137613 (comment 5538478657).

What Problem This Solves

An explicit agents.defaults.compaction.memoryFlush.model resolves exactly and drops the fallback chain:

// A memory-flush maintenance model is an exact override: do not let a failed
// local flush silently fall through to the paid active conversation fallback.
return { ...options, provider, model, requestedRouteResolution: "raw", fallbacksOverride: [] };

That guard is right and this does not remove it. A flush pointed at a local or free-tier model should not quietly start billing the operator's paid conversation model every time that model is unreachable.

The gap is that it is the only available behaviour. memoryFlush exposes enabled, model, softThresholdTokens, and forceFlushTranscriptBytes — nothing that says "prefer the cheap model, and here is what I accept falling back to". Today the choice is:

  • set model — cheap and fast, but one unavailable primary fails the flush outright, or
  • leave it unset — resilient, but the flush inherits whatever the turn ran on, so a large conversation model does summarisation it does not need to do.

memoryFlush.fallbacks makes the third option expressible. The operator names, in configuration, exactly which models they accept paying for on this path — so the fall-through is deliberate and visible rather than silent, which is what the original guard was protecting.

Behaviour

model fallbacks Result
unset any Unchanged: the flush follows the active model and its fallbacks.
set omitted Unchanged from today: exact override, no fall-through.
set [] or all-blank Treated as omitted — the exact override stands.
set ["a", "b"] Tried in order after the override; blanks dropped, order preserved.

Nothing changes for any existing configuration: the new key is optional and its absence reproduces current behaviour exactly.

Evidence

Motivation from a live deployment (OpenClaw 2026.8.1): primary ollama/glm-5.3:cloud, fallback anthropic/claude-sonnet-5, memoryFlush.model: ollama/glm-5.3-flash:cloud.

With the flush model set and its quota exhausted, every flush failed outright:

memoryFlush = { kind: "failed", failureCount: 1 }
error: "⚠️ API rate limit reached. Please try again later."
memory/<date>.md unchanged

Confirmed the primary was genuinely unavailable at that moment, not merely slow — a direct turn on the same model returned ⚠️ API rate limit reached. With a reachable flush model the same setup completed and appended to the memory file, so the failure was model availability rather than the flush path.

That is the case this field is for: the operator wanted the cheap model first and Sonnet as the named replacement, and could not express it. Unsetting model restored resilience but moved summarisation onto the large conversation model even when the cheap one was healthy.

Tests

extensions/memory-core/src/flush-plan.test.ts covers the plan resolver: declared refs reach the plan with blanks dropped and order preserved, and omitted / empty / all-blank lists all resolve to undefined so the exact-override default holds.

Notes

  • fallbacks is ignored when model is unset, since the flush already follows the active model's chain there. The help text says so; a schema-level dependency would be stricter but the config surface has no precedent for one that I could find.
  • Refs are validated the same way the rest of the fallback chain is — no extra resolution is introduced here.
  • Motivation from a live deployment: primary ollama/glm-5.3:cloud, fallback anthropic/claude-sonnet-5. With model: ollama/glm-5.3-flash:cloud set, every flush failed with ⚠️ API rate limit reached once the Ollama weekly quota ran out; unsetting model restored resilience but moved summarisation onto Sonnet even when the cheap model was available.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BjsHL4YEa67pAiPpSY3svm

@clawsweeper

clawsweeper Bot commented Sep 4, 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 docs Improvements or additions to documentation gateway Gateway runtime extensions: memory-core Extension: memory-core size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Sep 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR lets memory-flush model overrides specify a primary model and named fallbacks, with matching validation, discovery, Doctor repair, and documentation.

Example: The operator selects ollama/qwen3:8b for memory flushing and permits anthropic/claude-haiku-4-5 as its fallback.

  • Before: An unavailable Ollama model fails the flush because an explicit flush override disables conversation fallbacks.
  • After: The nested model selector permits the named Anthropic fallback while retaining exact behavior for existing string overrides.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The prior validation defect is repaired, but the patch duplicates a newly available capability and its current selector lacks shipped-entry-point proof.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: Operators cannot configure a cheap flush model with an independently named backup through the existing memoryFlush.model setting.
Reason: Named fallbacks have clear operator value, but the new core surface overlaps an existing plugin capability and lacks recorded owner direction.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep this PR open under the same-author pairing guard; current main now offers plugin routing that overlaps the proposed core selector, so the implementation direction needs reconsideration.

Priority: P2
Reviewed head: 882420be58e7b1d75946752869f3993512e20d95
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should memory-flush fallback policy use the existing plugin routing hook, or should OpenClaw also expose the proposed core selector and additive flush-plan contract?
  • Recommendation: Use the existing plugin hook: Scope before_model_resolve to trigger memory and return the accepted primary and fallback list.
  • Why: The operator problem is concrete, but current main now supports memory-specific fallback overrides through an existing extension point, and no maintainer approval accepts the additional configuration surface.

Before merge

  • Add real behavior proof - The earlier embedded live trace recovered from an unavailable primary and wrote memory using the former sibling fallback field; current nested-selector evidence runs real validation and planning with mocked fallback dispatch and providers. If the selector is retained, provide redacted terminal output or logs showing nested-selector recovery and the resulting durable note, plus latest-stable upgrade/Doctor behavior preserving existing string settings and data; redact credentials, addresses, phone numbers, and private endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Use the existing memory-turn routing hook before adding a core selector (P1) - Current main now passes trigger "memory" to before_model_resolve before candidate planning, and run-entry honors a returned fallbacksOverride even when flush preparation supplied an exact empty list. A plugin can therefore select ollama/qwen3:8b and its explicitly accepted backup only for memory turns. Adding this selector and parallel MemoryFlushPlan fallback field creates another configuration contract for that same policy without establishing why the existing path is insufficient. Use the supported hook, or establish a concrete missing contract before retaining this core expansion. This is new evidence from the routing capability merged after the previous review.
  • Complete next step - If retaining this branch, resolve the reported merge conflict through current main's memory-flush-prepare.ts owner while preserving memory-slot plan handling.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P1] Use the existing memory-turn routing hook before adding a core selector — src/config/zod-schema.agent-defaults-base.ts:227

Tests

  • Missing end-to-end proof: Missing current nested-selector runtime recovery with a durable note and a latest-stable upgrade/Doctor run preserving existing string configuration; a base-failing regression run is not shown.
Agent review details

How this fits together

The memory plugin builds a maintenance plan from configuration; the reply runner forwards its model selection into shared fallback dispatch and records the flush outcome.

flowchart LR
  A[Operator configuration] --> B[Schema validation]
  B --> C[Memory plugin flush plan]
  C --> D[Memory maintenance runner]
  D --> E[Shared model fallback dispatch]
  E --> F[Durable memory and flush status]
Loading

Technical review

Best possible solution:

Implement memory-only fallback policy through the existing routing hook unless maintainers establish a concrete need for additional core configuration.

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

Source confirms that an explicit flush model disables inherited fallbacks; this is intentional behavior, and no target code was executed during this review.

Is this the best way to solve the issue?

The selector preserves the existing cost guard, but current main's memory-trigger routing hook can express the requested primary and fallback policy without these additional core contracts.

Full review comments:

  • [P1] Use the existing memory-turn routing hook before adding a core selector — src/config/zod-schema.agent-defaults-base.ts:227
    Current main now passes trigger "memory" to before_model_resolve before candidate planning, and run-entry honors a returned fallbacksOverride even when flush preparation supplied an exact empty list. A plugin can therefore select ollama/qwen3:8b and its explicitly accepted backup only for memory turns. Adding this selector and parallel MemoryFlushPlan fallback field creates another configuration contract for that same policy without establishing why the existing path is insufficient. Use the supported hook, or establish a concrete missing contract before retaining this core expansion. This is new evidence from the routing capability merged after the previous review.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.92

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Exact memory-flush override keeps the original intent (540cbe2: Prevent failed local maintenance models from silently using paid conversation fallbacks.)
  • Doctor compaction-route handling keeps the original intent (Keep Codex compaction on native threads #82027: Preserve native Codex compaction and repair stale model routes without treating maintenance-only references as whole-agent routing changes.)
  • Configured model discovery keeps the original intent (30e1556: Centralize configured model-reference collection in the model-catalog package.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e4d1b7e adds src/plugins/registry-contribution-types.ts:235 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e4d1b7e0d38c; files: src/plugins/registry-contribution-types.ts)

PR surface

Source +81, Tests +212, Docs +8, Generated +2. Total +303 across 23 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 11 92 11 +81
Tests 5 217 5 +212
Docs 4 14 6 +8
Config 0 0 0 0
Generated 3 5 3 +2
Other 0 0 0 0
Total 23 328 25 +303

Review metrics

Metric Value Why it matters
Configuration surface Core baseline budget 2463 → 2466 The selector expands the maintained configuration surface, making its value relative to existing plugin routing material to product review.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded operator-facing memory-maintenance improvement rather than an urgent runtime regression.
  • merge-risk: 🚨 compatibility: The patch broadens persisted model configuration and adds fallback behavior to the public MemoryFlushPlan contract.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

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 (17 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-07T18:11:05.614Z sha 2ae459de4de86695b14a39a84248c36d0c82ff4d :: needs real behavior proof before merge. :: [P2] Exclude inactive flush fallbacks from model discovery
  • reviewed 2026-09-07T19:25:51.373Z sha 7230233200fbb23fc16cbaf741b7e0c613359fa6 :: needs real behavior proof before merge. :: [P2] Exclude inactive flush fallbacks from model discovery
  • reviewed 2026-09-07T19:45:56.587Z sha 879e1aaa826ce7ddedca2aac4f86cb93aee0c508 :: needs real behavior proof before merge. :: [P2] Exclude inactive flush fallbacks from model discovery
  • reviewed 2026-09-23T06:54:22.547Z sha 879e1aaa826ce7ddedca2aac4f86cb93aee0c508 :: needs real behavior proof before merge. :: [P2] Exclude inactive flush fallbacks from model discovery
  • reviewed 2026-09-24T12:26:58.665Z sha f31f9e6e214aee945115b4f51164af96bc8f9abd :: needs real behavior proof before merge. :: [P2] Restore the generated config baselines | [P2] Reject or ignore fallbacks without a flush primary
  • reviewed 2026-09-24T14:20:17.164Z sha 60edeee84c24dab4586211cf271df45f20000fd9 :: needs real behavior proof before merge. :: [P2] Reject fallback-only flush selectors before dispatch
  • reviewed 2026-09-24T14:44:07.845Z sha a29a88e :: needs real behavior proof before merge. :: [P2] Require a primary for flush fallback selectors
  • reviewed 2026-10-07T00:43:43.187Z sha 882420b :: needs real behavior proof before merge. :: none

Reviewed October 21, 2026, 1:02 AM ET / 05:02 UTC (Revision 18).

@zijunl

zijunl commented Sep 4, 2026

Copy link
Copy Markdown
Author

Moving this to draft: the config-surface ratchet needs a generated artifact I cannot produce here.

core: current 2420 > budget 2418; config surface grew; either remove config elsewhere or
consciously raise the budget in docs/.generated/config-baseline.counts.json in this PR
and justify it in the PR body.
Config baseline drift detected. Hash mismatch: docs/.generated/config-baseline.sha256
If this config-surface change is intentional, run `pnpm config:docs:gen` and commit the updated hash file.

That is the correct gate for this change — adding a config key is exactly what it is meant to make deliberate — and the budget bump is intentional here, so the answer is to run pnpm config:docs:gen and commit the regenerated counts and hash with a justification. I do not have an installed checkout of this repo in the environment I am working from, so I cannot regenerate the hash honestly; hand-editing the counts file without the matching generated output would just move the failure.

oxfmt is fixed in 87adc060.

Everything else in the diff stands as written, and the shape is unchanged from the proposal in #137613: memoryFlush.fallbacks is optional, omitted reproduces today's exact-override behaviour, and the existing cost guard is preserved rather than removed. Happy for a maintainer to take it from here, or I can finish it once I can run the generator.

@zijunl
zijunl marked this pull request as draft September 4, 2026 10:29
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 4, 2026
@zijunl

zijunl commented Sep 4, 2026

Copy link
Copy Markdown
Author

Unblocked: 1e9631fc commits the regenerated docs/.generated/config-baseline.{counts.json,sha256} from pnpm config:docs:gen, run against a local checkout rather than hand-edited.

The core config surface goes 2420 → 2422. The budget bump is deliberate: the key exists so an operator can name the models they accept paying for on the flush path, which the exact-override default cannot express, and there is no existing key to trade away for it.

Verified locally:

extensions/memory-core/src/flush-plan.test.ts        8 passed (8)
generate-config-doc-baseline.ts --check              OK
oxfmt --check (all 8 changed source files)           clean

@zijunl
zijunl marked this pull request as ready for review September 4, 2026 17:49
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 4, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this Sep 4, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 4, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Sep 4, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this Sep 4, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label Sep 4, 2026
@zijunl

zijunl commented Sep 4, 2026

Copy link
Copy Markdown
Author

Exact-head proof: a configured flush model that is unavailable now selects a named fallback and the flush completes.

Built this branch from source and ran a real turn against it — openclaw --version reports 2026.8.1 (02d3337), this branch's head. The config accepted the new key, which is itself part of the evidence that the schema plumbing lands:

"memoryFlush": {
  "enabled": true,
  "model": "ollama/glm-5.3-flash:cloud",
  "fallbacks": ["openrouter/auto"],
  "forceFlushTranscriptBytes": 10
}

The primary flush model is genuinely unavailable — that Ollama account is past its weekly limit and returns 429 ... weekly usage limit.

A probe on the flush's model selection shows the declared list reaching it:

{"flushModel": "ollama/glm-5.3-flash:cloud",
 "declaredFallbacks": ["openrouter/auto"],
 "runModel": "openrouter/auto", "runProvider": "openrouter"}

The runtime then selected it:

model fallback decision: decision=candidate_succeeded
  requested=ollama/glm-5.3-flash:cloud candidate=openrouter/openrouter/auto reason=unknown next=none

And the flush completed rather than failing: memoryFlush = {"kind": "succeeded", "compactionCount": 0}, with memory/<date>.md written on the same turn.

On current main the same configuration cannot express this. With memoryFlush.model set, fallbacksOverride: [] makes the selection exact, and the identical setup produces reason=rate_limit next=none — the flush simply fails whenever its cheap model is unreachable. That is the failure I hit on a live deployment before this change, and the reason the field exists.

Path note. This ran on the embedded path (openrouter primary), not through a CLI backend. On this branch a claude-cli turn never reaches flush model selection at all — the isCli exclusion in runMemoryFlushIfNeeded returns skipped first, which is what #138129 addresses separately. The selection logic this PR changes is backend-independent, so the embedded path exercises it directly; I have not observed the two changes composed.

Local against this head: configured-model-refs.test.ts 20 passed, flush-plan.test.ts 8 passed, codex-route-warnings.test.ts 132 passed, doctor/model-catalog/memory-core 2899 passed across 182 files. tsgo:core, oxlint, oxfmt --check and generate-config-doc-baseline --check all clean. Branch merged with current main; GitHub reports it mergeable.

The probe was added to the local build only and is not in the diff. The run used a throwaway state directory, not a live workspace.

@zijunl
zijunl force-pushed the feat/memory-flush-fallbacks branch 2 times, most recently from 841e5e9 to 2ae459d Compare September 7, 2026 18:04
@zijunl

zijunl commented Sep 7, 2026

Copy link
Copy Markdown
Author

CI note: acp-spawn.authority is a load-sensitive flake, not this PR

checks-node-compact-* failed on:

src/agents/subagents/spawn/acp-spawn.authority.test.ts
  > pending ACP spawn authority > transfers initialized ACP work only from its live parent: runtime / abort
AssertionError: cleanup completes before spawn returns: expected { …(11) } to be undefined
Test Files  1 failed | 135 passed (136)

Evidence it is not caused by either branch:

Worth filing separately as a flaky test; happy to open that if it is not already tracked.

I have no re-run rights on this repo, so I rebased onto current main to retrigger. Before pushing I ran the actual gates rather than a subset: check:test-types (all three tsconfig projects), tsgo:core, deadcode:knip, format:check, and format:docs:check — all exit 0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BjsHL4YEa67pAiPpSY3svm

zijunl and others added 2 commits September 24, 2026 14:30
Rebuilt on current upstream/main: memoryFlush.model now uses the canonical
AgentModelConfig selector ({ primary, fallbacks }) so operators can name the
fallback models they accept paying for on the pre-compaction flush path. A
bare string keeps the exact-override default: an unreachable maintenance
model never silently bills the paid conversation model.

Flush-selector fallbacks flow through configured-model-refs collection and
the doctor's codex-route repair/scan, and the flush plan carries them to
the runner's fallback options.
The rebuild accidentally dropped docs/.generated/config-baseline.counts.json
and config-baseline.sha256, breaking check-docs and the baseline ratchets
(count budget file missing + hash mismatch).

Restore both files and regenerate: the PR intentionally grows the config
surface by 3 core entries (memory-flush fallback naming), so the counts
ratchet core 2463 -> 2466 and the sha256 is updated accordingly.
@zijunl
zijunl force-pushed the feat/memory-flush-fallbacks branch from 60edeee to a29a88e Compare September 24, 2026 14:34
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. label Sep 24, 2026
A `{ fallbacks: [...] }` selector with no primary passed config
validation, but dispatch ignored the operator's fallbacks and silently
inherited the active conversation model's fallback chain. memoryFlush.model
now uses MemoryFlushModelSchema, which requires a primary whenever
fallbacks are supplied. Bare-string configs keep the exact-override
default unchanged.

Adds validation tests (accept string/primary-led selector, reject
fallback-only, stored-string upgrade round-trip) and a
configuration -> plan -> dispatch test proving a validated nested
selector recovers through the named fallback and records the memory
write.
@zijunl

zijunl commented Oct 7, 2026

Copy link
Copy Markdown
Author

Repair pushed to feat/memory-flush-fallbacks (882420b, on top of a29a88e): addresses the P2 "Require a primary for flush fallback selectors" finding.

What changed

  • src/config/zod-schema.agent-model.ts: new MemoryFlushModelSchema — refines the shared AgentModelSchema so a fallback-only { fallbacks: [...] } object is rejected at config validation. Other model-selector consumers are untouched.
  • src/config/zod-schema.agent-defaults-base.ts: agents.defaults.compaction.memoryFlush.model now uses MemoryFlushModelSchema; bare-string configs keep the exact-override default byte-for-byte.
  • extensions/memory-core/api.ts: exports buildMemoryFlushPlan so core tests can use the real plan resolver through the public API barrel.
  • docs/concepts/memory.md + src/config/schema.help.agents.ts: document that flush fallbacks require a primary.

Tests / evidence (all real runs, no live model calls)

  • src/config/zod-schema.agent-defaults.test.ts (3 new): accepts string / { primary } / { primary, fallbacks }; rejects fallback-only selectors (incl. blank-primary); a stored string memoryFlush.model survives validateConfigObject unchanged (existing-config upgrade evidence). File: 69/69 pass.
  • src/auto-reply/reply/agent-runner-memory.test.ts (1 new, "recovers through named flush fallbacks from a validated nested selector"): exercises the nested selector through real validateConfigObject → real buildMemoryFlushPlan → dispatch with the primary failing and the named fallback recovering; asserts fallbacksOverride is the operator's list (not the conversation chain), outcome completed, and the memory-write record persisted. File: 133/133 pass.
  • extensions/memory-core/src/flush-plan.test.ts + index.test.ts: 41/41 pass. oxfmt/oxlint clean on touched files; scoped tsc typecheck of the changed sources passes (full-project tsgo OOMs in this sandbox; noted, not a code signal).

Honest limits: the fallback-recovery run uses the standard mocked model runner (no live provider calls), so it proves configuration → plan → dispatch agreement, not a live provider round-trip. No real credentials, endpoints, or user paths appear in any artifact.

Still needs maintainers: the core-config-surface product decision — whether pre-compaction memory flush should gain this operator-facing selector at all. The repair only makes the selector safe if accepted.

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. label Oct 7, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Oct 21, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 21, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale after 7 days without qualifying human activity.
Without new human activity, Barnacle may close it as not planned 7 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed.
A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.

steipete added a commit that referenced this pull request Oct 24, 2026
* fix: use session model policy for memory flushes

Remove the separate memory-flush model override from configuration and
plugin plans. Reuse the active session model and normal fallback policy,
and migrate existing settings through Doctor with a recorded notice.

Supersedes #138144. Related: #137613.

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

* test: verify memory flush fallback handoff

* docs: retire memory flush override from capability taxonomy

* test(memory): remove obsolete flush model fixtures

---------

Co-authored-by: zijunl <[email protected]>
@steipete

Copy link
Copy Markdown
Contributor

Thanks @zijunl for the implementation and fallback-recovery investigation. Superseded by #182208, following the maintainer decision to remove memoryFlush.model. Doctor removes existing settings with a recorded notice, and flushes use the active session model and its normal fallback chain.

@steipete steipete closed this Oct 24, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
…#182208)

* fix: use session model policy for memory flushes

Remove the separate memory-flush model override from configuration and
plugin plans. Reuse the active session model and normal fallback policy,
and migrate existing settings through Doctor with a recorded notice.

Supersedes openclaw#138144. Related: openclaw#137613.

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

* test: verify memory flush fallback handoff

* docs: retire memory flush override from capability taxonomy

* test(memory): remove obsolete flush model fixtures

---------

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

Labels

commands Command implementations docs Improvements or additions to documentation extensions: memory-core Extension: memory-core gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants