Skip to content

fix(models): model picker retries callbacks during catalog replacement - #169478

Merged
obviyus merged 1 commit into
mainfrom
fix/model-picker-successor-publication
Oct 12, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/model-picker-successor-publication

Conversation

@obviyus

@obviyus obviyus commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes a Telegram model-picker callback being retried when a pending model catalog is replaced, even though it should wait for the new catalog and complete on its first attempt.

User Impact

Model browsing waits for the committed replacement catalog instead of briefly failing against a retired publication. No authentication, permissions, or stored-data changes.

Why This Change Was Made

Refreshing the catalog supersedes the earlier publication gate. Superseding a gate wakes its readers before the replacement has committed. A one-shot wait then selects an unavailable owner and forces ingress recovery. Follow successor publication gates before resolving the owner. Preserve exact-config acquisition semantics and the existing zero-retry end-to-end assertion.

The native-Claude fixture failure in the same e2e file has an independent test-only repair.

Evidence

Baseline: 5889e62f4902b8f3fa4b6eb2cecbbd26f5b8ceb0.

  • Before: recovers a replaced model catalog and drains the following Telegram callback completed with ingress attempts 1, not the required 0.
  • A focused owner-boundary regression covers a reader admitted before replacement and exact-config rejection across that replacement.
  • The existing 24-case owner-selection suite passed during focused diagnosis.
  • The new regression failed on the unchanged owner with prepared model runtime owner is stale after config publication; both exact and published cases pass after the repair.
  • Rebuilt qaRuntime, then the real Gateway/Telegram-mock replacement scenario passed with its original attempts: 0, empty claim/pending/failed queues, and both completed callbacks assertions unchanged.
  • Independent autoreview: scoped-clean at P2.
  • tsgo:core, the consuming agents-other test graph, and all four root test graphs passed.
  • Changed-file Oxlint/Oxfmt and the line-cap ratchet passed. Documentation retains the exact-acquisition contract.

@clawsweeper

clawsweeper Bot commented Oct 12, 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 agents Agent runtime and tooling size: XS labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The PR makes model-catalog readers follow successor publication gates before selecting a published runtime.

Example: A model-picker reader starts before a pending catalog replacement is superseded.

  • Before: The reader wakes against a stale owner, causing the reported callback retry count to reach 1.
  • After: The reader waits for the replacement catalog; the reported Gateway scenario completes both callbacks with 0 retries.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, useful repair with meaningful owner-boundary coverage and no findings; execution evidence is a reported mock-endpoint run rather than an inspectable shipped-entry-point artifact.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored PR is outside the ordinary contributor-proof gate; its body reports the changed publication owner exercised through a rebuilt real Gateway and mock Telegram replacement scenario, with zero retries and drained queues, without a linked raw artifact.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Model browsing briefly fails and retries when a pending catalog publication is replaced.
Reason: The collaborator-authored direction repairs an evidenced shared-owner failure with a focused change and preserves exact acquisition semantics.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR repairs a current publication-wait failure in the shared owner. No introduced correctness or security defect was found.

Priority: P2
Reviewed head: a3b6ff143c7672d4b98570c07cb66f026f1ed07b

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied execution report covers a real Gateway with a mock Telegram endpoint; no shipped-entry-point trace or live Telegram artifact is supplied.
Agent review details

How this fits together

The prepared-model runtime owns published catalog generations between configuration reloads and catalog consumers; it accepts reader identity and configuration, waits for publication, and returns the selected snapshot or lease.

flowchart TD
  A[Catalog consumer] --> B[Prepared catalog loader]
  B --> C[Published runtime owner]
  D[Configuration reload] --> E[Replacement publication gates]
  C --> E
  E --> F[Committed catalog snapshot]
  F --> A
Loading

Technical review

Best possible solution:

Follow successor gates in the existing publication owner while preserving exact-config rejection and lifecycle checks.

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

Current-main source exposes the failure directly: superseding a gate wakes its reader before the replacement commits, and the reader does not recheck the gate; the PR reports matching before/after failures, but no code was executed during this review.

Is this the best way to solve the issue?

The small shared-owner repair addresses premature owner selection without adding retries or changing catalog selection policy.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned patch: The introduced production change replaces a single gate wait with a loop that rereads the pending replacement after each wake, preserving lifetime and admission checks. (src/agents/prepared-model-runtime.published-owner.ts:135, a3b6ff143c76)
  • Current-main failure mechanism: Fetched main still waits only once. Invalidation installs a successor gate and resolves the superseded gate before the successor commits, allowing the old implementation to select a stale owner. (src/agents/prepared-model-runtime.published-owner.ts:135, 521393ecd7d1)
  • Focused regression: The added cases start readers before replacement, then require published reads to return the replacement configuration while exact catalog acquisition rejects with PreparedModelCatalogConfigReplacedError. (src/agents/prepared-model-runtime.published-replacement.test.ts:15, a3b6ff143c76)
  • Reported boundary validation: The complete PR body reports the regression failing before repair and a rebuilt real-Gateway/mock-Telegram scenario passing with attempts 0, completed callbacks, and empty ingress queues; no raw execution artifact is linked. (a3b6ff143c76)
  • Independent companion repair: fix(qa): Telegram picker fixture rejects native model discovery #169476 repairs Claude discovery in the Telegram test fixture and explicitly leaves catalog-replacement assertions unchanged; it does not supersede this product fix. (fb6a8a5c112d)
  • History and policy: Root and applicable agents, docs, and test policies were read; no maintainer-notes directory exists. File history and published-owner blame establish shared ownership. Some deeper content-history queries were limited by unavailable local blobs; supplied provenance and GitHub PR bodies cover the changed wait policy. (AGENTS.md:1, 521393ecd7d1)

Likely related people:

  • Peter Steinberger: Raw commit c3f242f adds src/agents/prepared-model-runtime.published-owner.ts:26 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c3f242fe0a79; files: src/agents/prepared-model-runtime.published-owner.ts)

PR surface

Source +2, Tests +42, Docs +4. Total +48 across 4 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 1 4 2 +2
Tests 2 42 0 +42
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 50 2 +48

Labels

Label changes:

  • add P2: Repairs a bounded model-browsing failure during catalog replacement that currently requires ingress recovery.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Repairs a bounded model-browsing failure during catalog replacement that currently requires ingress recovery.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

Reviewed October 11, 2026, 8:30 PM ET / October 12, 2026, 00:30 UTC.

@obviyus
obviyus merged commit f284985 into main Oct 12, 2026
146 checks passed
@obviyus
obviyus deleted the fix/model-picker-successor-publication branch October 12, 2026 00:39
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
openclaw#169478)

## What Problem This Solves

Fixes a Telegram model-picker callback being retried when a pending model catalog is replaced, even though it should wait for the new catalog and complete on its first attempt.

## User Impact

Model browsing waits for the committed replacement catalog instead of briefly failing against a retired publication. No authentication, permissions, or stored-data changes.

## Why This Change Was Made

Refreshing the catalog supersedes the earlier publication gate. Superseding a gate wakes its readers before the replacement has committed. A one-shot wait then selects an unavailable owner and forces ingress recovery. Follow successor publication gates before resolving the owner. Preserve exact-config acquisition semantics and the existing zero-retry end-to-end assertion.

The native-Claude fixture failure in the same e2e file has an independent test-only repair.

## Evidence

Baseline: `11f576b23cf70615ca4504eb12fdba93591b9c8f`.

- Before: `recovers a replaced model catalog and drains the following Telegram callback` completed with ingress attempts `1`, not the required `0`.
- A focused owner-boundary regression covers a reader admitted before replacement and exact-config rejection across that replacement.
- The existing 24-case owner-selection suite passed during focused diagnosis.
- The new regression failed on the unchanged owner with `prepared model runtime owner is stale after config publication`; both exact and published cases pass after the repair.
- Rebuilt `qaRuntime`, then the real Gateway/Telegram-mock replacement scenario passed with its original `attempts: 0`, empty claim/pending/failed queues, and both completed callbacks assertions unchanged.
- Independent autoreview: scoped-clean at P2.
- `tsgo:core`, the consuming agents-other test graph, and all four root test graphs passed.
- Changed-file Oxlint/Oxfmt and the line-cap ratchet passed. Documentation retains the exact-acquisition contract.

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 docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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.

1 participant