Skip to content

fix: reuse prepared catalogs and repair Gateway E2E fixtures - #136915

Merged
steipete merged 4 commits into
mainfrom
fix/release-gateway-e2e-regressions
Sep 3, 2026
Merged

steipete merged 4 commits into
mainfrom
fix/release-gateway-e2e-regressions

Conversation

@steipete

@steipete steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users browsing models through Telegram or Gateway RPC repeatedly triggered provider discovery instead of reusing the prepared catalog. Also repairs three stale Gateway E2E fixtures that blocked release validation: confirmed announcement delivery, private sandbox workspace writes, and ACP adapter startup.

These failures were already present on c92d0ae9c07e in Full Release Validation run 1 / Release Checks, as well as on a41af7eb71a95 in run 2 / Release Checks. They were not introduced by the intervening release cherry-picks. The duplicated CI summaries account for the reported 42 announcement failures and two ACP failures.

Why This Change Was Made

Inventory callers now refresh content when the catalog owner marks it stale after authentication changes. Ordinary reads reuse the prepared generation, and explicit refresh still forces discovery. The shared catalog owner handles that policy for Telegram commands, CLI listing, and Gateway models.list; turn-path reads retain their existing behavior. Production delta: +4 lines, needed to distinguish those refresh intents and propagate the owner's type. No configuration, environment, schema, or protocol surface is added.

The announcement fixture now supplies the committed source-reply receipt required by production. The Docker test verifies that none permits private writes without exposing or modifying the host workspace. The ACP fixture delegates adapter resolution to its owning plugin instead of hardcoding a nonexistent root dependency path. No delivery guard, sibling-reroute fix, sandbox boundary, or cancellation check is removed. The sandbox owner test also uses its temporary-workspace helper so existing /tmp/workspace/skills content cannot alter the fixture.

User Impact

Prepared models remain available while browsing when discovery is unavailable. Explicit refresh and auth-change recovery remain supported. The other changes improve release validation without changing runtime behavior.

Evidence

Item Before After
A — announce formatting 21/87 failed locally at both release tips 87/87 passed
B — prepared model picker Original CI: 6 discovery calls vs 2; strengthened local fixture: 8 vs 3 Both picker cases passed; discovery stayed frozen until explicit refresh
C — workspace isolation Test incorrectly rejected successful private write Real OrbStack Docker: none/ro/rw passed; host sentinel preserved
D — ACP cancellation Deterministic MODULE_NOT_FOUND for root adapter path Real adapter process passed replacement and queued-successor cancellation proof

The picker fixture uses the Ollama API's raw response shape, waits for full catalog readiness, and verifies a model absent from configuration across callbacks and RPC with discovery disabled. It separately verifies explicit refresh reaches the provider. The replacement-catalog callback case remains covered.

ACP dependency inspection also covered the installed adapter's CODEX_PATH entry point and Codex app-server initialization and turn interruption. The fixture repair preserves that process protocol.

Asserted Gateway behavior from the passing run:

{"scenario":"telegram-model-picker-prepared-gateway","verdict":"pass","callbackAcknowledgements":4,"postWarmDiscoveryAttempts":0,"discoveredOnlyModelRetained":true,"explicitRefreshReachedProvider":true,"replacementCallbackRecovered":true}

On the release-based candidate, all 12 owner test files pass (482 tests), including 39 requester-wake cases and 259 announcement-delivery cases. The final independent review found no actionable P0–P2 findings. The committed private-QA runtime build passed and the combined four-file E2E run passed 91/91 on release-based head 01f106dd37a0979ea71724932d7103a48a3f05c3. The broad pnpm check:changed run passed all architecture, type, full-lint, and import-cycle checks, then found six pre-existing redundant <void> arguments in the ACP fixture. Those were removed; the focused pnpm check:changed --base HEAD --head HEAD -- test/e2e/qa-lab/runtime/webhooks-taskflow-cancellation-authz.e2e.test.ts recovery run passed. The ACP E2E also passed again after that type-only cleanup.

Initial local Gateway timeouts were missing private-QA build artifacts; building the same private-QA profile used by CI fixed startup without increasing timeouts. Full Release Validation itself has not been rerun. Telegram/Ollama proof uses a real Gateway with mock HTTP services; ACP uses the installed adapter with a synthetic app-server fixture; sandbox proof uses Docker.

Release cherry-picks, in order:

  • 8229b8fcb61fa3a4e5b0c80acff087547a7904d4
  • 1dfddb6e8fa7f57fcc60c4f01384b679e88ad77a
  • 85079b8ca7571f48537ef3b0ce5d393880b8b0c7
  • 1e15a1d9ce4cb7ff9d1364ea8b4fe2528ef81c55

These four commits rebased cleanly onto 41419be40bbb17e5eed318992c8e3bf1aee6199b. Applying their patches sequentially to a41af7eb71a95f7fc1ebc83d1b34d8a7a4ed0fe7 reproduced the verified release candidate tree exactly (5fcea21d19edfc87037f2c8ff75504da269970cd). The private-QA build and all 91 E2E cases also passed on final main-based head 1e15a1d9ce4cb7ff9d1364ea8b4fe2528ef81c55.

Named follow-up: replace the existing literal-only thread-routing cases in the announcement format suite with runtime-backed assertions; those unrelated cases are unchanged here.

Focused E2E invocation (after the private-QA runtime build):

OPENCLAW_BUILD_PRIVATE_QA=1 OPENCLAW_ENABLE_PRIVATE_QA_CLI=1 \
OPENCLAW_E2E_WORKERS=2 OPENCLAW_E2E_USE_PREBUILT_DIST=1 \
node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts \
  src/agents/subagents/announce/subagent-announce.format.e2e.test.ts \
  test/e2e/qa-lab/runtime/telegram-model-picker-prepared-gateway.e2e.test.ts \
  test/e2e/qa-lab/runtime/openclaw-sandbox-workspace-isolation.e2e.test.ts \
  test/e2e/qa-lab/runtime/webhooks-taskflow-cancellation-authz.e2e.test.ts

@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime commands Command implementations agents Agent runtime and tooling extensions: qa-lab size: M maintainer Maintainer-authored PR labels Sep 3, 2026
@steipete
steipete marked this pull request as ready for review September 3, 2026 03:05
@steipete
steipete requested a review from a team as a code owner September 3, 2026 03:05
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 2, 2026, 11:50 PM ET / September 3, 2026, 03:50 UTC.

ClawSweeper review

What this changes

This PR distinguishes stale catalog recovery from forced provider discovery for model browsing and repairs Gateway E2E fixtures for announcements, sandbox workspaces, and ACP startup.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open: the model-catalog change is owner-bound, but the ACP fixture still proves only that an interrupt RPC was sent, not that the cancelled turn terminated. The prior P2 remains unresolved.

Priority: P2
Reviewed head: 078bd464c996d441e9817f818276d75324f12ae2

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The catalog repair is focused, but the ACP E2E still cannot establish actual target cancellation.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a MEMBER-authored PR, so the external-contributor proof gate does not apply. The body reports real Gateway and Docker runs, but unavailable direct Codex source inspection means its asserted ACP terminal protocol was not treated as proof for the remaining cancellation-coverage issue.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a MEMBER-authored PR, so the external-contributor proof gate does not apply. The body reports real Gateway and Docker runs, but unavailable direct Codex source inspection means its asserted ACP terminal protocol was not treated as proof for the remaining cancellation-coverage issue.
Evidence reviewed 5 items Catalog owner and Gateway caller: The introduced owner policy gives inventory callers a stale-only refresh intent while Gateway models.list passes forced refresh only for explicit refresh requests.
ACP fixture does not model cancellation: The process fixture awaits a blocking user-input request, replies {} to turn/interrupt, and only emits a completed turn after that request resolves; it has no interrupted terminal path.
Introduced ACP launcher repair: The introduced hunk removes the root-level adapter override, making this test exercise the plugin-owned launcher while retaining the unchanged non-cancelling process fixture.
Findings 1 actionable finding [P2] Make the ACP fixture terminate interrupted turns
Security None None.

How this fits together

The prepared model catalog is lifecycle-owned data used by Telegram model pickers, CLI listing, and Gateway models.list to present available models. ACPX E2E fixtures run a Gateway through its plugin-owned adapter launcher to verify cancellation behavior.

flowchart LR
  Browse[Telegram, CLI, or Gateway model browse] --> CatalogOwner[Prepared catalog owner]
  AuthChange[Authentication change] --> Stale[Catalog marked stale]
  CatalogOwner --> Decision[Reuse cache or refresh inventory]
  Decision --> ModelOutput[Picker and RPC model results]
  E2E[Gateway cancellation E2E] --> ACPX[ACPX plugin launcher]
  ACPX --> Fixture[ACP process fixture]
  Fixture --> Cancellation[Interrupted turn outcome]
Loading

Before merge

  • Make the ACP fixture terminate interrupted turns (P2) - Removing the adapter override makes this process fixture the cancellation oracle, but it still acknowledges turn/interrupt and leaves its pending user-input request unresolved until the test releases it. The test therefore proves only that an interrupt RPC was sent, not that the cancelled target terminates before its queued successor. This is the prior P2 still outstanding.
  • Resolve merge risk (P1) - The ACP test can pass after an interrupt request while the target turn remains blocked and later completes normally, leaving cancellation regressions undetected in release validation.
  • Resolve merge risk (P1) - Production code grows by four net lines; the third refresh intent is justified at the catalog owner, but no net-neutral expression of that distinct policy is apparent.
  • Resolve merge risk (P1) - The required sibling Codex source checkout was absent and direct upstream inspection was blocked by network resolution, so the PR-body assertion about Codex's exact interrupted terminal event was not accepted as dependency proof.
  • Complete next step (P2) - Repair the ACP fixture so turn/interrupt produces and asserts an interrupted terminal target before merge.

Findings

  • [P2] Make the ACP fixture terminate interrupted turns — test/e2e/qa-lab/runtime/webhooks-taskflow-cancellation-authz.e2e.test.ts:260-265
Agent review details

Security

None.

PR surface

Source +4, Tests +34, Other 0. Total +38 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 6 18 14 +4
Tests 8 127 93 +34
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 15 146 108 +38

Review metrics

Metric Value Why it matters
Production versus test delta production +18/-14 (net +4); tests and QA fixtures +128/-94 The small production increase carries the new stale-only refresh intent; most of the change is focused regression and E2E coverage.

Merge-risk options

Maintainer options:

  1. Repair the cancellation oracle (recommended)
    Make the ACP process fixture terminate an interrupted turn and assert that terminal result before the queued successor proceeds.
  2. Pause the ACP fixture repair
    Do not merge the fixture-startup repair until maintainers accept coverage that verifies cancellation rather than only interrupt transport.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Update the ACP fixture so turn/interrupt settles the blocked turn as interrupted, then assert target termination and queued-successor isolation.

Technical review

Best possible solution:

Retain the catalog-owner refresh split, then make the ACP fixture settle its pending request as interrupted and assert target termination before proving that a queued successor remains unaffected.

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

Yes, from source: trigger the fixture's blocking user-input turn, send turn/interrupt, and observe that it remains pending until the test manually releases it. This read-only review did not execute that path.

Is this the best way to solve the issue?

No. The catalog fix is at the correct lifecycle owner, but the ACP fixture must model and assert the interrupted terminal outcome to validate the cancellation behavior it claims to cover.

Full review comments:

  • [P2] Make the ACP fixture terminate interrupted turns — test/e2e/qa-lab/runtime/webhooks-taskflow-cancellation-authz.e2e.test.ts:260-265
    Removing the adapter override makes this process fixture the cancellation oracle, but it still acknowledges turn/interrupt and leaves its pending user-input request unresolved until the test releases it. The test therefore proves only that an interrupt RPC was sent, not that the cancelled target terminates before its queued successor. This is the prior P2 still outstanding.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4af3fc294575.

Labels

Label justifications:

  • P2: The remaining defect weakens a release-validation cancellation check but does not change the production cancellation implementation.
  • merge-risk: 🚨 automation: Merging would allow the ACP E2E to report cancellation coverage while accepting an interrupt acknowledgment without a cancelled terminal outcome.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This is a MEMBER-authored PR, so the external-contributor proof gate does not apply. The body reports real Gateway and Docker runs, but unavailable direct Codex source inspection means its asserted ACP terminal protocol was not treated as proof for the remaining cancellation-coverage issue.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The catalog change affects the user-visible Telegram model picker, so its visible picker flow should receive Telegram Test Server proof.

Evidence

What I checked:

  • Catalog owner and Gateway caller: The introduced owner policy gives inventory callers a stale-only refresh intent while Gateway models.list passes forced refresh only for explicit refresh requests. (src/agents/prepared-model-catalog.ts:79, 078bd464c996)
  • ACP fixture does not model cancellation: The process fixture awaits a blocking user-input request, replies {} to turn/interrupt, and only emits a completed turn after that request resolves; it has no interrupted terminal path. (extensions/acpx/test/fixtures/codex-app-server.mjs:75, 078bd464c996)
  • Introduced ACP launcher repair: The introduced hunk removes the root-level adapter override, making this test exercise the plugin-owned launcher while retaining the unchanged non-cancelling process fixture. (test/e2e/qa-lab/runtime/webhooks-taskflow-cancellation-authz.e2e.test.ts:260, 078bd464c996)
  • Current-main path comparison: No listed catalog, fixture, or cancellation-test path changed between the pinned base and fetched main, so the checkout establishes the current pre-PR behavior for these paths; source blobs beyond the checkout could not be fetched because the promisor remote was unreachable. (4af3fc294575)
  • Model-catalog history: A merged ancestor commit by Peter Steinberger recently established captured model-catalog visibility state, making him a relevant routing candidate. (src/agents/prepared-model-catalog.ts, 62da19367b3f)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Josh Avant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Model turn/interrupt as target cancellation with an interrupted terminal event, then assert the target ends before the queued successor completes.

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-03T03:13:58.688Z sha 1e15a1d9ce4cb7ff9d1364ea8b4fe2528ef81c55 :: blocked before merge. :: [P2] Make the ACP fixture complete an interrupted turn

The successful announce fixture supplied only aggregate message-tool evidence,
which no longer proves a committed final reply to the source conversation.
Supply the receipt owned by the embedded runner without changing delivery
policy or requester-wake sibling rerouting.

Proof: the format suite failed 21 of 87 tests at both c92d0ae and
a41af7e; all 87 pass with the corrected fixture.
Inventory callers forced full discovery on every browse while trying to
refresh auth-stale content. Give the prepared catalog owner a distinct stale
refresh intent, preserve explicit forced refresh, and leave ordinary turn
reads on their existing facts. Apply the policy to commands, CLI, and RPC.

Correct the Ollama fixture response contract and await full catalog readiness.
Verify discovered-only models survive callbacks and RPC while discovery is
unavailable, and verify explicit refresh still reaches the provider.

Proof: before the fix, the real Gateway made 8 discovery calls after a 3-call
warmup, and the owner policy regressions failed. Prepared catalog and auth
reload owner tests now pass (43 tests).
The Docker scenario treated workspaceAccess=none as a read-only private
workspace. The sandbox mount owner intentionally provides private writable
storage while hiding the host and agent workspaces.

Assert a private write/read succeeds and the same-named host sentinel stays
unchanged. Keep read-only write rejection and read-write host persistence.
Use a unique temporary workspace in the owner test so ambient /tmp skills
cannot add unexpected mounts.

Proof: OrbStack Docker reproduced the old assertion on successful exit zero;
the complete none/read-only/read-write scenario now passes.
The cancellation fixture hardcoded a root node_modules adapter path, but
acpx owns that dependency. This caused deterministic MODULE_NOT_FOUND startup
failures in both release validation runs, not an agent startup flake.

Remove the override so the canonical plugin launcher resolves its adapter;
retain the synthetic Codex app-server process through CODEX_PATH.

Proof: the real installed adapter process passes cancellation authorization,
rejects stale replacements without interrupting them, and preserves queued
successors when the preceding run is cancelled.
@steipete
steipete force-pushed the fix/release-gateway-e2e-regressions branch from 1e15a1d to 078bd46 Compare September 3, 2026 03:42
@steipete
steipete merged commit 0e7564a into main Sep 3, 2026
211 checks passed
@steipete
steipete deleted the fix/release-gateway-e2e-regressions branch September 3, 2026 04:24
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…w#136915)

* test(agents): model confirmed source replies in announce fixtures

The successful announce fixture supplied only aggregate message-tool evidence,
which no longer proves a committed final reply to the source conversation.
Supply the receipt owned by the embedded runner without changing delivery
policy or requester-wake sibling rerouting.

Proof: the format suite failed 21 of 87 tests at both c92d0ae and
a41af7e; all 87 pass with the corrected fixture.

* fix(models): reuse prepared catalogs when browsing inventory

Inventory callers forced full discovery on every browse while trying to
refresh auth-stale content. Give the prepared catalog owner a distinct stale
refresh intent, preserve explicit forced refresh, and leave ordinary turn
reads on their existing facts. Apply the policy to commands, CLI, and RPC.

Correct the Ollama fixture response contract and await full catalog readiness.
Verify discovered-only models survive callbacks and RPC while discovery is
unavailable, and verify explicit refresh still reaches the provider.

Proof: before the fix, the real Gateway made 8 discovery calls after a 3-call
warmup, and the owner policy regressions failed. Prepared catalog and auth
reload owner tests now pass (43 tests).

* test(sandbox): verify writable private workspace isolation

The Docker scenario treated workspaceAccess=none as a read-only private
workspace. The sandbox mount owner intentionally provides private writable
storage while hiding the host and agent workspaces.

Assert a private write/read succeeds and the same-named host sentinel stays
unchanged. Keep read-only write rejection and read-write host persistence.
Use a unique temporary workspace in the owner test so ambient /tmp skills
cannot add unexpected mounts.

Proof: OrbStack Docker reproduced the old assertion on successful exit zero;
the complete none/read-only/read-write scenario now passes.

* test(acpx): use the plugin-owned adapter launcher

The cancellation fixture hardcoded a root node_modules adapter path, but
acpx owns that dependency. This caused deterministic MODULE_NOT_FOUND startup
failures in both release validation runs, not an agent startup flake.

Remove the override so the canonical plugin launcher resolves its adapter;
retain the synthetic Codex app-server process through CODEX_PATH.

Proof: the real installed adapter process passes cancellation authorization,
rejects stale replacements without interrupting them, and preserves queued
successors when the preceding run is cancelled.
obviyus added a commit that referenced this pull request Sep 3, 2026
Collapses the model-list cleanup (#135912) and the provider-login branch into
one change rebased onto main.

- models.list reads one closed catalog source (gateway, prepared, published);
  the CLI `models list` and chat `/models` consume the prepared catalog directly.
- Prepared model runtime: owners publish one curated build, live discovery runs
  only in the catalog worker, and secret-free provider-auth facts captured at
  build time replace native readiness reobservation and auth-mode flags.
- Provider login: one login runtime shared by the CLI, chat `/login`, Telegram,
  and the Control UI; `openclaw.setup.auth.start` owns interactive sign-in.
- First-run setup inference saves the credential, confirms the in-memory
  candidate with one tool-free turn, and commits config only on success.
- xai catalog derives from the manifest; Codex native auth probes the CLI;
  doctor repairs legacy model refs and session routes.

Integration with main: keeps the worker discovery plan (#137063), worker plugin
scoping (#135486), auth order and profile identity (#132450, #137022), the
plugin-owned Codex/Claude login readers, and the built-artifact preference for
setup revalidation (#136036). Drops main's readiness reobservation (#134524)
and stale-refresh catalog mode (#136915): the prepared build already carries
the provider-auth facts those paths re-derived.

Claude-Session: https://claude.ai/code/session_01CnvVXNnjjQGMrBLYjq29RP
obviyus added a commit that referenced this pull request Sep 12, 2026
## What Problem This Solves

New provider models stay hidden after saved inventory expires, until an explicit refresh.

## Why This Change Was Made

#136915 removed repeat acquisition when it reused prepared catalogs. This restores expiry-driven discovery without making readers wait. @steipete for awareness.

Production +199/-105 (net +94); test tooling +7/-4; tests/support +214/-6; docs +5. Growth carries original cache deadlines through the existing acquisition path; duplicate normalization and separate inventory maps are removed.

## User Impact

Reads return saved rows immediately, then show new models after renewal. Failed providers keep saved rows and their warning while healthy siblings renew.

## Evidence

Telegram/Gateway with synthetic responses: main kept 8 rows after expiry; saved rows returned in 90 ms, then the ninth appeared. CLI agrees. Post-login reply: 67 ms. 16 valid config shapes started; invalid legacy input rejected. Getter-backed results retain accepted rows. Full consumer details: `consumers.md`.

## Compatibility

No config keys, database changes, migrations, or public plugin API changes.

## Consumers

- `models.list`, CLI, selectors, `/models`, `/think` menus, and sticker vision: renewed metadata.
- Public agent-runtime getters and setup-shell thinking defaults: saved metadata can start background renewal.
- `models status`: renewed metadata for visibility.
- Chat metadata publication listener: invalidates cached metadata after renewal.
- Catalog warnings: persist until the failed scope succeeds or its inputs change. CLI row output omits the warning.

census: generic refreshCommittedProviderCatalogs reviewed — 2 callers listed
census: generic error reviewed — 0 callers listed

## Invalidation

Cache hits and compatible reloads preserve deadlines. Changed credentials, provider settings, or plugins retire old facts. Restart rebuilds inventory. Explicit refresh retries failures; native refresh retains its scope.

## Contention

Existing discovery queue and pending request; concurrent reads return saved rows during a held response.

## Tests

Registered `models.list`: expiry, accepted projection, held responses, coalescing, failed siblings, warning recovery. Reload-auth cases: startup/reload publication and snapshot access. Startup-static and test-harness edits produce reply fixtures. Owner/cache checks pass; the test runner prepares the SDK runtime first. Structural checks pass.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
…aw#146317)

## What Problem This Solves

New provider models stay hidden after saved inventory expires, until an explicit refresh.

## Why This Change Was Made

openclaw#136915 removed repeat acquisition when it reused prepared catalogs. This restores expiry-driven discovery without making readers wait. @steipete for awareness.

Production +199/-105 (net +94); test tooling +7/-4; tests/support +214/-6; docs +5. Growth carries original cache deadlines through the existing acquisition path; duplicate normalization and separate inventory maps are removed.

## User Impact

Reads return saved rows immediately, then show new models after renewal. Failed providers keep saved rows and their warning while healthy siblings renew.

## Evidence

Telegram/Gateway with synthetic responses: main kept 8 rows after expiry; saved rows returned in 90 ms, then the ninth appeared. CLI agrees. Post-login reply: 67 ms. 16 valid config shapes started; invalid legacy input rejected. Getter-backed results retain accepted rows. Full consumer details: `consumers.md`.

## Compatibility

No config keys, database changes, migrations, or public plugin API changes.

## Consumers

- `models.list`, CLI, selectors, `/models`, `/think` menus, and sticker vision: renewed metadata.
- Public agent-runtime getters and setup-shell thinking defaults: saved metadata can start background renewal.
- `models status`: renewed metadata for visibility.
- Chat metadata publication listener: invalidates cached metadata after renewal.
- Catalog warnings: persist until the failed scope succeeds or its inputs change. CLI row output omits the warning.

census: generic refreshCommittedProviderCatalogs reviewed — 2 callers listed
census: generic error reviewed — 0 callers listed

## Invalidation

Cache hits and compatible reloads preserve deadlines. Changed credentials, provider settings, or plugins retire old facts. Restart rebuilds inventory. Explicit refresh retries failures; native refresh retains its scope.

## Contention

Existing discovery queue and pending request; concurrent reads return saved rows during a held response.

## Tests

Registered `models.list`: expiry, accepted projection, held responses, coalescing, failed siblings, warning recovery. Reload-auth cases: startup/reload publication and snapshot access. Startup-static and test-harness edits produce reply fixtures. Owner/cache checks pass; the test runner prepares the SDK runtime first. Structural checks pass.

Co-authored-by: Ayaan Zaidi <[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 commands Command implementations extensions: qa-lab gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant