Skip to content

fix(discord): refresh model picker after default changes#104635

Merged
steipete merged 4 commits into
openclaw:mainfrom
compoodment:codex/fix-discord-model-picker-hot-reload
Jul 11, 2026
Merged

fix(discord): refresh model picker after default changes#104635
steipete merged 4 commits into
openclaw:mainfrom
compoodment:codex/fix-discord-model-picker-hot-reload

Conversation

@compoodment

@compoodment compoodment commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #104614.

Discord model-picker components captured the channel startup config. After a hot reload changed the default or model catalog, old component clicks could reset or apply against stale data while /status and direct /model commands already used the active runtime config.

Why This Change Was Made

The component handler now captures the active runtime config once per interaction and uses it consistently for routing, picker data, display, dispatch, and post-apply verification.

Model-bearing component state now carries a compact stable provider/model token instead of relying on catalog or recent-list positions. This prevents a hot reload from silently retargeting an old visible selection when models are inserted, removed, or reordered. Legacy positional components expire safely once the runtime config changes.

User Impact

Users can change the default model or catalog without restarting Discord or the gateway. Existing current-format picker buttons keep selecting the model they display; stale legacy buttons ask the user to choose again instead of applying a different model.

Evidence

  • Fresh sanitized AWS Crabbox run run_c7c34dfb462e on exact reviewed head 102dec62f9416c2374422be2e31d5e66ea6117ab: 72/72 focused Discord picker tests passed.
  • After detecting and removing a malformed 100-file sync commit, the patch was rebuilt cleanly on current main at 7fc241d1a14340a6ba77b930f10ed711607ecaf3. Stable patch id f94c16dc97d295825b17b9a98900e17a3db2662d matches the exact tested revision; the PR is again the intended six files.
  • Fresh exact-final-head sanitized AWS Crabbox run run_62769f71ce42: 72/72 focused tests passed.
  • Fresh Codex autoreview on the exact code bundle: clean, correctness confidence 0.91.
  • Targeted oxfmt and git diff --check passed.
  • Hosted CI is green on the final clean exact-tested head.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: S labels Jul 11, 2026
@compoodment
compoodment force-pushed the codex/fix-discord-model-picker-hot-reload branch 2 times, most recently from 70ff378 to 4e2cf56 Compare July 11, 2026 19:09
@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 4:43 PM ET / 20:43 UTC.

Summary
The PR updates Discord model-picker state, rendering, and interaction handling to use the active runtime configuration and stable model identities across hot reloads.

PR surface: Source +106, Tests +184. Total +290 across 6 files.

Reproducibility: yes. at source level. The linked issue provides a concrete live pre-fix scenario, and current main clearly keeps provider-start configuration in the long-lived component context while runtime configuration can be replaced by hot reload.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: extensions/discord/src/monitor/model-picker.state.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #104614
Summary: This PR is the direct candidate fix for the canonical linked Discord stale-picker bug; no competing canonical fix was found.

Members:

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

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦞 diamond lobster
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted after-fix live Discord proof of the hot-reload and picker interaction path, then update the PR body for automatic re-review or ask a maintainer to comment @clawsweeper re-review.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The exact head has strong focused test and hosted-CI evidence, but no after-fix real Discord interaction proof; add a redacted recording, transcript, live output, or runtime log, then update the PR body to trigger a fresh review or ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • [P1] The contributor has not yet shown the after-fix behavior in a real Discord setup, so the focused tests could still miss an integration-specific interaction, rendering, or hot-reload lifecycle difference.

Maintainer options:

  1. Decide the mitigation before merge
    Retain this bounded plugin-local implementation and land it after attaching redacted live Discord evidence showing a default or catalog hot reload followed by both an old picker interaction that refreshes or expires safely and a current tokenized selection that applies the model displayed.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] No code repair is identified; the contributor should provide real Discord behavior proof before the exact head proceeds through normal maintainer merge handling.

Security
Cleared: The Discord-only source and test changes introduce no concrete dependency, workflow, secret, permission, package-resolution, downloaded-code, or other supply-chain concern.

Review details

Best possible solution:

Retain this bounded plugin-local implementation and land it after attaching redacted live Discord evidence showing a default or catalog hot reload followed by both an old picker interaction that refreshes or expires safely and a current tokenized selection that applies the model displayed.

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

Yes at source level. The linked issue provides a concrete live pre-fix scenario, and current main clearly keeps provider-start configuration in the long-lived component context while runtime configuration can be replaced by hot reload.

Is this the best way to solve the issue?

Yes. One active configuration per interaction plus compact, ambiguity-safe model identities is the narrowest maintainable fix and reuses the canonical runtime snapshot and model-command paths; only real after-fix integration proof remains missing.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦞 diamond lobster.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The exact head has strong focused test and hosted-CI evidence, but no after-fix real Discord interaction proof; add a redacted recording, transcript, live output, or runtime log, then update the PR body to trigger a fresh review or ask a maintainer to comment @clawsweeper re-review.

Label justifications:

  • P2: This fixes a normal-priority Discord model-selection correctness and UX problem with limited channel scope and no crash, data loss, or broad outage.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦞 diamond lobster.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The exact head has strong focused test and hosted-CI evidence, but no after-fix real Discord interaction proof; add a redacted recording, transcript, live output, or runtime log, then update the PR body to trigger a fresh review or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +106, Tests +184. Total +290 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 127 21 +106
Tests 2 192 8 +184
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 319 29 +290

What I checked:

Likely related people:

  • steipete: Introduced effective runtime choices and recently maintained the Discord picker/runtime-config integration, including several commits on this PR after its initial contribution. (role: recent adjacent owner; confidence: high; commits: 6171b4254d41, 23716de4468b; files: extensions/discord/src/monitor/native-command-model-picker-interaction.ts, extensions/discord/src/monitor/native-command-model-picker-ui.ts, extensions/discord/src/monitor/provider.interactions.ts)
  • rendrag-git: Substantially refactored Discord picker state, navigation, and interaction rendering for large model catalogs in the merged picker PR. (role: recent picker contributor; confidence: high; commits: e9dd1c43c4c3; files: extensions/discord/src/monitor/model-picker.state.ts, extensions/discord/src/monitor/native-command-model-picker-interaction.ts, extensions/discord/src/monitor/native-command-model-picker-ui.ts)
  • jalehman: Updated the picker current-model path at the session override versus default-model boundary. (role: recent session-metadata contributor; confidence: medium; commits: 7e2b2d2987b2; files: extensions/discord/src/monitor/native-command-model-picker-ui.ts)
  • scoootscooob: Moved the Discord implementation into its current extension boundary, making this contributor relevant to the surrounding ownership history. (role: historical Discord extension contributor; confidence: low; commits: 5682ec37fada; files: extensions/discord/src/monitor/model-picker.state.ts, extensions/discord/src/monitor/native-command-model-picker-interaction.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (6 earlier review cycles)
  • reviewed 2026-07-11T19:21:07.975Z sha a63ecaa :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-11T19:29:03.683Z sha a63ecaa :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-11T19:54:41.950Z sha 102dec6 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-11T20:03:53.060Z sha 102dec6 :: needs real behavior proof before merge. :: [P1] Use a real config generation for legacy expiry
  • reviewed 2026-07-11T20:18:07.385Z sha 4c82748 :: needs real behavior proof before merge. :: [P1] Use a real config generation for legacy expiry
  • reviewed 2026-07-11T20:35:03.445Z sha 7fc241d :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/fix-discord-model-picker-hot-reload branch from 4e2cf56 to a63ecaa Compare July 11, 2026 19:15
@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Jul 11, 2026
@steipete
steipete force-pushed the codex/fix-discord-model-picker-hot-reload branch from a63ecaa to f44a13b Compare July 11, 2026 19:33
@steipete
steipete force-pushed the codex/fix-discord-model-picker-hot-reload branch from f44a13b to 102dec6 Compare July 11, 2026 19:45
@clawsweeper clawsweeper Bot added 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. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed 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 Jul 11, 2026
@steipete

steipete commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Land-ready maintainer proof:

  • Exact head: 7fc241d1a14340a6ba77b930f10ed711607ecaf3.
  • Focused sanitized AWS Crabbox: run_62769f71ce42; 72 Discord model-picker tests passed.
  • Exact-head hosted CI: run 29166967852, green.
  • Fresh exact-head autoreview: no findings, confidence 0.91.
  • Current-main merge-tree simulation: clean; resulting diff remains six files, 319 additions and 29 deletions.
  • Repository-native review artifacts: validated with zero findings.
  • Repository-native prepare: OPENCLAW_TESTBOX=1 scripts/pr prepare-run 104635; hosted exact-head gates passed and the remote PR tree matched the prepared tree.

The refactor reads the hot-reloaded config at interaction time and carries compact stable model identity through Discord components. Legacy positional state remains usable until config changes; malformed, expired, missing, or ambiguous tokens fail closed with a reselect notice.

@steipete
steipete requested a review from a team as a code owner July 11, 2026 20:12
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: googlechat Channel integration: googlechat channel: imessage Channel integration: imessage channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nostr Channel integration: nostr channel: signal Channel integration: signal labels Jul 11, 2026
@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(discord): refresh model picker after default changes This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete force-pushed the codex/fix-discord-model-picker-hot-reload branch from 4c82748 to 7fc241d Compare July 11, 2026 20:24
@openclaw-barnacle openclaw-barnacle Bot removed docs Improvements or additions to documentation channel: googlechat Channel integration: googlechat channel: imessage Channel integration: imessage channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nostr Channel integration: nostr channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web channel: zalo Channel integration: zalo app: macos App: macos labels Jul 11, 2026
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M 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.

[Bug]: Discord /model picker shows stale model after hot-reloaded default switch

2 participants