Skip to content

fix(channels): honor pinned accounts in Mattermost model menus - #144880

Merged
obviyus merged 1 commit into
mainfrom
fix/136257-channel-menus
Sep 11, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/136257-channel-menus

Conversation

@obviyus

@obviyus obviyus commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Channel model menus could show learned choices from a shared account after the session pinned a different, expired account. Slash and thread-picker requests omitted session context.

Why This Change Was Made

Both affected channel entry points read the latest session and pass it to the shared menu builder; thread interactions use the thread session. Other thinking-menu callers now preserve an explicitly empty catalog.

User Impact

Model choices honor the session account pin. Existing native thinking controls remain available. No configuration or protocol change is required.

Evidence

A real Gateway with a controlled channel transport exercised registered slash and thread callbacks. Healthy → expired → healthy → expired pins correctly removed and restored account-only choices after the fix; the baseline retained them. No inference was sent. Telegram Test Server /think retained all seven buttons with an empty provider list. Focused channel suites passed 13, 21, and 71 cases.

Related: #136257.

@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: mattermost Channel integration: mattermost channel: slack Channel integration: slack channel: telegram Channel integration: telegram size: S maintainer Maintainer-authored PR labels Sep 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 7:28 AM ET / 11:28 UTC.

ClawSweeper review

What this changes

Mattermost model menus read the current session’s pinned account and runtime, while Discord, Slack, and Telegram preserve explicitly empty thinking-menu catalogs.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix absent from current main. No blocking defect was found, and the broader related draft does not supersede it.

Priority: P2
Reviewed head: 603be85e3630a8481095480b7d3f24ecbd89cbc5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair reuses established owners, extends existing regression coverage, and has no blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The verified repository maintainer is exempt from the external-contributor proof gate. Supplied Mattermost boundary-harness results exercise session-pin changes through both menu entry points; the separate Telegram Test Server output supports preserved thinking choices. No new authority boundary requires additional final-effect proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The verified repository maintainer is exempt from the external-contributor proof gate. Supplied Mattermost boundary-harness results exercise session-pin changes through both menu entry points; the separate Telegram Test Server output supports preserved thinking choices. No new authority boundary requires additional final-effect proof.
Evidence reviewed 10 items Mattermost context forwarding: The interaction handler reads the latest entry using the thread session key; the slash handler reads the routed conversation session. Both pass it into the existing shared builder without adding selection policy.
Existing shared eligibility contract: The shared builder already forwards the session profile, explicit-pin source, provider, and runtime to the catalog decision owner. This patch supplies missing input to that contract; it does not introduce another account-policy implementation or change a dependency protocol.
Existing invalid-pin behavior: Current tests distinguish supported OAuth failover from invalid expired-token, missing, wrong-provider, and unresolved-reference pins; invalid pins are rejected before shared credentials are considered. The repair preserves this existing distinction.
Findings None None.
Security None None.

How this fits together

Channel command handlers combine conversation state with OpenClaw’s shared model catalog to build interactive menus. Mattermost now supplies the same session context that the shared eligibility owner already understands.

flowchart TD
  A[Mattermost slash command or picker click] --> B[Existing authorization and conversation routing]
  B --> C[Read current conversation session]
  C --> D[Shared model eligibility builder]
  E[Published catalog and account eligibility] --> D
  D --> F[Render model menu]
  F --> G[Existing model selection dispatch]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +14, Tests +32. Total +46 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 6 20 6 +14
Tests 1 34 2 +32
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 54 8 +46

Review metrics

None.

Technical review

Best possible solution:

Keep model eligibility with the shared catalog owner and consistently supply the target conversation’s current session state.

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

Yes, source establishes the path: pin an invalid expired-token account while a healthy shared account exposes learned models, then open a Mattermost slash or thread menu. Main omits the session input required to filter those choices; this review did not execute the scenario.

Is this the best way to solve the issue?

Yes. Supplying current session context to the existing eligibility builder is a narrow repair, and preserving empty catalogs follows the existing command-menu contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs misleading Mattermost model choices under a session account pin, with limited scope and no demonstrated core outage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The verified repository maintainer is exempt from the external-contributor proof gate. Supplied Mattermost boundary-harness results exercise session-pin changes through both menu entry points; the separate Telegram Test Server output supports preserved thinking choices. No new authority boundary requires additional final-effect proof.

Label justifications:

  • P2: This repairs misleading Mattermost model choices under a session account pin, with limited scope and no demonstrated core outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The verified repository maintainer is exempt from the external-contributor proof gate. Supplied Mattermost boundary-harness results exercise session-pin changes through both menu entry points; the separate Telegram Test Server output supports preserved thinking choices. No new authority boundary requires additional final-effect proof.

Evidence

What I checked:

  • Mattermost context forwarding: The interaction handler reads the latest entry using the thread session key; the slash handler reads the routed conversation session. Both pass it into the existing shared builder without adding selection policy. (extensions/mattermost/src/mattermost/monitor-model-picker.ts:203, 603be85e3630)
  • Existing shared eligibility contract: The shared builder already forwards the session profile, explicit-pin source, provider, and runtime to the catalog decision owner. This patch supplies missing input to that contract; it does not introduce another account-policy implementation or change a dependency protocol. (src/auto-reply/reply/commands-models.ts:238, 520bf609efac)
  • Existing invalid-pin behavior: Current tests distinguish supported OAuth failover from invalid expired-token, missing, wrong-provider, and unresolved-reference pins; invalid pins are rejected before shared credentials are considered. The repair preserves this existing distinction. (src/agents/model-auth-availability.session-pin.test.ts:106, 520bf609efac)
  • Still necessary on main and latest release: The inspected Mattermost picker on both pinned main and v2026.9.4 calls the builder without session context. The two affected Mattermost production files are unchanged between the PR’s reported reproduction baseline and its intake base. (extensions/mattermost/src/mattermost/monitor-model-picker.ts:206, 520bf609efac)
  • Empty catalog semantics: Command choices and menus use nullish fallback for missing catalogs, so an explicit empty array is a meaningful existing input. The four caller changes preserve that distinction without changing the shared API. (src/auto-reply/commands-registry.ts:387, 520bf609efac)
  • Supplied behavior evidence and its limits: The captured PR body reports healthy→expired→healthy→expired pin transitions through both Mattermost entry points, with the base session held healthy during thread checks. It identifies transport and admission as fixture boundaries. Its separate Telegram Test Server transcript shows all seven thinking choices; that supports Telegram preservation, not live Mattermost behavior. Focused test results are contributor-reported and were not rerun in this read-only review. (603be85e3630)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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.

@obviyus
obviyus merged commit 7764767 into main Sep 11, 2026
123 checks passed
@obviyus
obviyus deleted the fix/136257-channel-menus branch September 11, 2026 11:45
@obviyus

obviyus commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

Landed after clean exact-head review and green CI.

Proof: Compiled baseline and candidate Gateways registered real Mattermost slash and interaction routes against an external HTTP/WebSocket fixture. Actual posts created the parent and thread sessions; default authorization and signed callbacks remained active.

Current session pin Baseline, both menus Candidate, both menus
Healthy account-only present account-only present
Expired account-only present account-only absent
Healthy again account-only present account-only present
Expired again account-only present account-only absent

The parent stayed pinned to the healthy account. The same thread reply and session survived all four steps. Captured outbound writes and stored post records agree; all callbacks returned HTTP 200.

Telegram Test Server /think still delivered all seven controls. The four empty-catalog edits are contract cleanup, not a claim of a distinct reproduced Telegram defect. Focused checks passed: 13 Mattermost, 21 Discord, 71 Slack.

The first local review rejected the earlier route-injected harness. The later review inspected the full registered-Gateway records and resolved that finding. No product source changed during this proof correction.

vincentkoc added a commit that referenced this pull request Sep 11, 2026
Preserve the reviewed harness while incorporating the landed benchmark prerequisite.

Punchcard-Session: coral-orchard-orchard-d4

* commit '4407ed19ac63b1c1c84a0cfe6eb4bbeca9c2322c': (1196 commits)
  fix(perf): isolate benchmark subprocess transport (#144159)
  refactor(auth): await Copilot cache persistence (#144810)
  refactor(web-fetch): exercise URL normalization through the public tool (#144887)
  fix(ollama): preserve hosted subdomain model context (#144891)
  fix(doctor): explain Codex plugin health failures (#144813)
  fix(channels): honor pinned accounts in Mattermost model menus (#144880)
  fix(update): failed-update records hide the triggering error behind the excerpt tail (#144729)
  fix(logging): preserve OpenClaw package references in diagnostics (#144808)
  fix: retain plugin detail tab selections while inspection loads (#144647)
  fix: keep discovered models when sign-in tokens renew (#144861)
  fix(update): preserve local package overrides (#89985)
  fix(update): resolve compatibility bridges within the runtime graph (#144831)
  chore(i18n): refresh native locales (#144856)
  fix: preserve child signal termination during CLI respawn (#144838)
  fix(text): hide encoded MiniMax tool envelopes (#126307)
  fix(subagents): deliver child replies that match the empty placeholder (#130647)
  fix(cli): reject blank message channel selectors (#144802)
  fix(telegram): preserve mixed text order and pending stop (#144839)
  fix(memory): restore FTS fallback for same-name view collisions (#144783)
  chore(release): close out 2026.9.4 on main (#144708)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 12, 2026
…law#144880)

Mattermost menus now use the latest session account/runtime context, including thread sessions. Native thinking-menu callers preserve explicit empty catalogs.

Validated with registered Gateway baseline/candidate flows, Telegram Test Server controls, focused channel checks, and green CI.

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

channel: discord Channel integration: discord channel: mattermost Channel integration: mattermost channel: slack Channel integration: slack channel: telegram Channel integration: telegram maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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