Skip to content

fix: apply Discord model picker choices without false failures - #135382

Merged
steipete merged 2 commits into
mainfrom
fix/model-picker-apply-contract
Sep 1, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/model-picker-apply-contract

Conversation

@steipete

@steipete steipete commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #133550. Related: #134731 (already fixed by #135095).

What Problem This Solves

Fixes an issue where Discord users selecting a model could hit the picker's timeout or see “No reply was generated” even though the chosen session model eventually persisted. Reported by @Call44.

The paired Control UI Ollama-row issue was already fixed by @obviyus in #135095 (e4cf6f59756c28f5a9b26f0f7be786aa47fae032). This change does not duplicate that repair; a fresh browser click/reload check confirms it. Thanks to @BoatAngle for that report.

Why This Change Was Made

The native-command fast path dropped the admitted model catalog while ordinary replies preserved it, forcing selection to rebuild catalog state. Forward the same snapshot and reuse completed, same-generation capability metadata before scoped discovery. The shared session-selection writer and its conflict/lock checks remain unchanged.

Discord intentionally captures the command's final reply after sending hooks so the picker can present it. Its suppression reason was lost at settlement, causing generic recovery to overwrite the real acknowledgement. Preserve that existing channel-owned suppression through the shared dispatcher; suppress recovery only when every queued final was intentionally captured. Real invisible results, hook cancellation, errors, and mixed outcomes remain recoverable. Hidden output is never counted as visible, and hooks are not bypassed.

User Impact

Discord picker choices apply promptly and display their actual success or rejection result. Native model selections reuse prepared catalog facts, including already-discovered thinking/input capabilities. No timeout increase, retries, new configuration, environment variables, schemas, protocol versions, or dependency changes.

Production: +61/-65 (net -4). Tests/test support: +225/-21 (net +204). Removed redundant private loader wrappers and consolidated duplicate outcome/count bookkeeping.

Evidence

Regression tests failed before the corresponding repairs: missing native catalog handoff, missing completed thinking/input metadata, and a spurious generic fallback after intentional post-hook capture. The ordinary invisible-result and mixed cancellation/failure controls passed before and after. The focused wrapper run passes 437 tests across shared selection, native replies, catalog projection, dispatch settlement, and Discord picker/plugin dispatch.

Real-flow proof used the built CLI, fresh isolated state, free loopback ports (never 18789), synthetic credentials, and a local Discord Gateway/REST fixture driving the actual native interaction handlers. No operator state or real Discord account was used.

Before, main 3ce74e3004f:
  Discord /model -> choose picker-secondary -> Submit
  catalog-loaded: 10,902 ms; native reply: 11,299 ms
  separate run exceeded unchanged 12-second picker timeout
  later persistence succeeded, but final notice: “No reply was generated ...”

After, candidate on main 6abc3adf10bf:
  isolated Gateway :55282, synthetic Ollama route :55281
  Discord /model -> choose picker-secondary -> Submit
  catalog-loaded: 1 ms
  reply: “Model set to ollama/picker-secondary for this session. Configured default update requested.”
  /status: ollama/picker-secondary, pinned session, OpenClaw Default runtime
  Submit through status verification: 1,698 ms

Control UI, fresh isolated Gateway :56250, Ollama route :56249:
  enabled Ollama row -> click picker-secondary
  sessions.patch observed -> selected model updated
  full page reload -> ollama/picker-secondary retained

The exact implicit/empty local-provider projection and remote/explicit-auth rejection variants remain covered by the catalog tests; the browser proof uses a configured isolated local route. Public Discord authentication/network latency is outside the synthetic-only proof.

The unrelated current-main TS7056 build blocker was repaired canonically in #135360 before this branch was refreshed. Runtime/UI rebuilds pass. One combined proof attempt had mismatched runtime/UI build identities due to concurrent builds; rebuilding the UI against the completed runtime identity resolved it, and the fresh UI replay passed. No production workaround was added.

The first CI run reported a shadowed test binding and an un-narrowed optional promise in aggregation. Both were corrected; targeted lint and 278 reply regressions pass after that follow-up.

Final post-lint runtime replay also passed: submit through /status confirmation in 1,311 ms, with the same selection retained on a second /status read after 20 seconds. The completed-catalog stage remained 1 ms.

Independent Codex autoreview of the final committed branch: scoped-clean, no accepted/actionable findings. Exact-head CI and openclaw/ci-gate are green. The two cancelled auxiliary workflows were rerun successfully. Native prepare/merge gates follow.

Pre-land ClawSweeper review (final head, 17:51 UTC): no actionable correctness/security findings. Both requested next steps are addressed: the complete exact-head rollup and required gate are green, and this PR proceeds through the ordinary native review/prepare/merge workflow, not a separate repair lane. The full local node scripts/check-changed.mjs --timed run also passed. No Rank-up moves or safeguards are being skipped.

NO-FOLLOW-UP: the useful nearby cleanup is already absorbed into the canonical catalog and outcome owners; no additional standalone refactor is justified by this repair.

Carry the admitted catalog into native commands and reuse completed capability facts. Preserve post-hook channel suppression through settlement so picker acknowledgements are not replaced by generic recovery.

Reported-by: @Call44 (#133550). Reverified the existing #134731 repair from #135095 with an isolated Control UI click and reload.
@clawsweeper

clawsweeper Bot commented Sep 1, 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 channel: discord Channel integration: discord agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 1, 2026
@steipete
steipete marked this pull request as ready for review September 1, 2026 17:16
Narrow observed final-delivery promises before aggregation and avoid a shadowed test catalog binding. Targeted lint and 278 reply regressions pass.
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 2:10 PM ET / 18:10 UTC.

ClawSweeper review

What this changes

The branch passes the admitted model catalog into native model selection and distinguishes Discord’s intentional captured reply from an ordinary invisible delivery so the picker retains its actual acknowledgement.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for normal maintainer handling. The introduced changes repair two source-proven gaps in the Discord picker path without adding configuration or widening authority.

Priority: P1
Reviewed head: 96f64d5046fcf1384508709f57f124c6006c5314

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-aligned bug repair with meaningful boundary coverage and supplied isolated native-flow evidence.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless supplies a terminal trace through the changed native Discord handler showing the selected model persisted and status confirmation succeeded.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless supplies a terminal trace through the changed native Discord handler showing the selected model persisted and status confirmation succeeded.
Evidence reviewed 8 items Current-main gap: Current main invokes the native slash-command fast path without the already prepared catalog, while the PR forwards that snapshot to the directive owner.
Catalog owner repair: The changed capability lookup now reads the completed catalog owned by the current prepared runtime before falling back to scoped discovery.
Delivery outcome repair: The dispatcher gives adapter-owned channel transformation its own outcome, excludes it from fallback delivery, and preserves ordinary invisible, cancelled, and pre-send-failure outcomes as recoverable.
Findings None None.
Security None None.

How this fits together

Discord native commands enter the shared reply pipeline, which resolves a model choice and writes the session override before the Discord adapter presents the result. The dispatcher settles delivery outcomes and decides whether generic no-reply recovery is appropriate.

flowchart LR
  A[Discord model picker] --> B[Native command path]
  B --> C[Admitted model catalog]
  C --> D[Session override]
  D --> E[Reply dispatcher]
  E --> F[Discord acknowledgement]
  E --> G[No-reply recovery]
Loading

Before merge

  • Resolve merge risk (P1) - The supplied check rollup is truncated and marked incomplete, so the normal merge gate should revalidate required checks on the exact head.
  • Complete next step (P2) - This protected maintainer-authored repair should remain in the ordinary maintainer review and merge path, not a ClawSweeper repair lane.
Agent review details

Security

None.

PR surface

Source -4, Tests +204. Total +200 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 7 61 65 -4
Tests 7 225 21 +204
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 286 86 +200

Review metrics

Metric Value Why it matters
Production versus regression-test delta production net -4; tests/test support net +204 The repair reduces production surface while adding focused boundary coverage for catalog reuse and delivery settlement.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #133550
Summary: This PR is the direct candidate repair for the reported Discord model-picker failure.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused owner-boundary repair once the normal exact-head merge gates confirm the complete check set.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the focused owner-boundary repair once the normal exact-head merge gates confirm the complete check set.

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

No independent reproduction was run in this read-only review; yes, the failure is source-reproducible because current main drops the prepared catalog before native selection and collapses intentional capture into an invisible result.

Is this the best way to solve the issue?

Yes. The branch carries the existing admitted snapshot through the native path and records the delivery distinction at the shared dispatcher rather than adding retries or extending timeouts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 10b2956f37c6.

Labels

Label justifications:

  • P1: The patch addresses a Discord model-selection failure that disrupts a real channel workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless supplies a terminal trace through the changed native Discord handler showing the selected model persisted and status confirmation succeeded.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: 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.

  • Confirm the complete exact-head required-check rollup through the normal merge gate.

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-01T17:51:08.999Z sha 96f64d5 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 01ea77e into main Sep 1, 2026
295 of 297 checks passed
@steipete
steipete deleted the fix/model-picker-apply-contract branch September 1, 2026 18:11
@steipete

steipete commented Sep 1, 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 2, 2026
…law#135382)

* fix: preserve native model picker selections and replies

Carry the admitted catalog into native commands and reuse completed capability facts. Preserve post-hook channel suppression through settlement so picker acknowledgements are not replaced by generic recovery.

Reported-by: @Call44 (openclaw#133550). Reverified the existing openclaw#134731 repair from openclaw#135095 with an isolated Control UI click and reload.

* fix: satisfy model picker delivery lint guards

Narrow observed final-delivery promises before aggregation and avoid a shadowed test catalog binding. Targeted lint and 278 reply regressions pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discord /model picker fails to apply session model override on 2026.8.1-beta.3 (stuck "still processing" / "Failed to apply")

1 participant