Skip to content

fix(models): respect auth order in picker label#83581

Closed
hclsys wants to merge 3 commits into
openclaw:mainfrom
hclsys:fix-model-picker-auth-order-label-83574
Closed

fix(models): respect auth order in picker label#83581
hclsys wants to merge 3 commits into
openclaw:mainfrom
hclsys:fix-model-picker-auth-order-label-83574

Conversation

@hclsys

@hclsys hclsys commented May 18, 2026

Copy link
Copy Markdown

Fixes #83574

Summary

  • Pass the OpenAI/Codex accepted auth-provider set into shared /models provider label rendering.
  • Add regression coverage so an explicit auth.order.openai Codex profile labels the picker as oauth instead of env api-key.

Validation

  • node scripts/run-vitest.mjs src/auto-reply/reply/commands-models.test.ts -> 24 passed
  • node scripts/run-vitest.mjs src/agents/model-auth-label.test.ts -> 14 passed
  • node scripts/run-vitest.mjs src/auto-reply/reply/commands-status.test.ts -> 21 passed
  • git diff --check -> passed
  • pnpm --config.verify-deps-before-run=false check:changed -> passed

Note: plain pnpm check:changed hung inside pnpm install after printing Done; reran with pnpm dependency auto-verify disabled so the actual changed checks executed.

@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 18, 2026
@clawsweeper

clawsweeper Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

Summary
The PR wires OpenAI/Codex-compatible auth providers into /models provider-label rendering, adds regression coverage, and records the user-facing fix in the changelog.

Reproducibility: yes. by source inspection. Current main calls the /models auth-label resolver for openai without acceptedProviderIds, and the PR wires that contract in but misses the Telegram callback agent-id callsite.

PR rating
Overall: 🦐 gold shrimp
Proof: 🐚 platinum hermit
Patch quality: 🦐 gold shrimp
Summary: Useful targeted fix with good terminal proof, but the Telegram native callback callsite needs one more agent-id threading repair before merge.

Rank-up moves:

  • Pass sessionState.agentId into the Telegram model-list callback header call and add focused coverage for the agent-specific runtime/auth-order case.
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.

PR egg
✨ Hatched: 🌱 uncommon Pearl Diff Drake

        /\     /\            
      _/  \___/  \_          
     /  ( o   o )  \         
    |      \_/      |        
    |   /\  ===  /\ |        
     \_/  \_____/  \_/       
        _/|_| |_|\_          
       /__| | | |__\         
          ' ' ' '            
         /_/     \_\         
       .-----------.         
      '-------------'        

Rarity: 🌱 uncommon.
Trait: stacks clean commits.
Share on X: post this hatch
Copy: My PR egg hatched a 🌱 uncommon Pearl Diff Drake in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • How to hatch it: reach status: 👀 ready for maintainer look or status: 🚀 automerge armed; that usually means sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

Real behavior proof
Override: A maintainer applied proof: override for this PR.

Mantis proof suggestion
A native Telegram Desktop capture would directly show the chat-facing auth label after choosing the OpenAI provider in the model picker. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

telegram desktop proof: verify /models openai shows the Codex-first OAuth auth label before env API-key fallback.

Risk before merge
Why this matters: - The Telegram native model-list callback can still render a default OpenAI/Codex auth label instead of the active agent's runtime/auth-order label because it does not pass sessionState.agentId to the new helper.

Maintainer options:

  1. Thread the Telegram agent id before merge (recommended)
    Pass sessionState.agentId into the Telegram callback formatModelsAvailableHeader call and add focused coverage for an agent-specific OpenAI runtime/auth-order label.
  2. Accept the narrower fix
    Maintainers can intentionally merge the text-command fix first and track the Telegram callback agent-specific gap separately if that edge is acceptable.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Thread `sessionState.agentId` through the Telegram `formatModelsAvailableHeader` callback call and add focused coverage for a Telegram model-list callback with an agent-specific OpenAI runtime/auth-order policy. Do not change dispatch auth routing or provider visibility.

Next step before merge
A narrow automated repair can finish the PR by threading the active Telegram agent id into the one remaining callback label callsite and adding focused coverage.

Security
Cleared: The diff is limited to auth-label rendering, tests, and changelog text; I found no concrete security or supply-chain regression.

Review findings

  • [P2] Pass the active Telegram agent into model-list labels — src/auto-reply/reply/commands-models.ts:396-400
Review details

Best possible solution:

Thread the active Telegram session agent id through the callback header path while keeping the shared auth-label resolver as the single source, then merge this PR and close #83574 as fixed.

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

Yes by source inspection. Current main calls the /models auth-label resolver for openai without acceptedProviderIds, and the PR wires that contract in but misses the Telegram callback agent-id callsite.

Is this the best way to solve the issue?

Not yet. Reusing the shared resolver is the right approach, but the native Telegram callback also needs agentId: sessionState.agentId so labels follow the same agent-specific runtime policy as dispatch.

Label justifications:

  • P2: This is a normal-priority auth-label correctness fix for a channel-visible command with limited blast radius.
  • merge-risk: 🚨 auth-provider: The remaining callback gap can display the wrong OAuth/API-key label for agent-specific OpenAI runtime/auth-order setups after the PR is merged.

Full review comments:

  • [P2] Pass the active Telegram agent into model-list labels — src/auto-reply/reply/commands-models.ts:396-400
    The new label path chooses OpenAI/Codex auth providers from resolveAgentHarnessPolicy, but the Telegram native list callback still calls formatModelsAvailableHeader without sessionState.agentId. For chats bound to a non-default agent or agent-specific OpenAI runtime policy, the callback can render the default Codex/OAuth label while dispatch uses that agent's Pi/API-key order; pass the active agent id at the callback callsite and cover that path.
    Confidence: 0.84

Overall correctness: patch is incorrect
Overall confidence: 0.84

Acceptance criteria:

  • node scripts/run-vitest.mjs src/auto-reply/reply/commands-models.test.ts
  • node scripts/run-vitest.mjs extensions/telegram/src/bot.test.ts
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Local blame and git log -S tie the current /models label helper, resolveModelAuthLabel, and OpenAI/Codex routing helper to the same current-main commit. (role: introduced current label/auth-routing surface; confidence: high; commits: 67f8683ca30a; files: src/auto-reply/reply/commands-models.ts, src/agents/model-auth-label.ts, src/agents/openai-codex-routing.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 38f11a084475.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. labels May 18, 2026
@openclaw-mantis

Copy link
Copy Markdown

Mantis Telegram Desktop Proof

Summary: Mantis did not generate before/after GIFs because this PR does not have a clean Telegram-visible before/after proof in the standard Mantis run.

Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-83581/run-26031470112-1/index.json

@hclsys

This comment was marked as low quality.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 18, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 18, 2026
@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label May 18, 2026
@clawsweeper

clawsweeper Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

🦞🔧
ClawSweeper saw the passing review, but the PR needs another repair pass before merge.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper verdict: pass (sha=06ee95df6608d29a395c52ba8ab53fdd93a9dc4f); current checks are failing: Real behavior proof:FAILURE
Action: repair worker queued. Run: https://github.com/openclaw/clawsweeper/actions/runs/26046052875
Model: gpt-5.5

I will update this PR branch, or open a safe credited replacement, if the repair worker finds a narrow CI fix.

Automerge progress:

  • 2026-05-18 16:15:19 UTC review queued 06ee95df6608 (after repair)
  • 2026-05-18 16:22:01 UTC review passed 06ee95df6608 (structured ClawSweeper verdict: pass (sha=06ee95df6608d29a395c52ba8ab53fdd93a9d...)

@clawsweeper clawsweeper Bot force-pushed the fix-model-picker-auth-order-label-83574 branch from a017c09 to 672434c Compare May 18, 2026 15:29
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels May 18, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 18, 2026
@clawsweeper clawsweeper Bot force-pushed the fix-model-picker-auth-order-label-83574 branch from 672434c to d0215b2 Compare May 18, 2026 15:51
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 18, 2026
@clawsweeper clawsweeper Bot force-pushed the fix-model-picker-auth-order-label-83574 branch from d0215b2 to 06ee95d Compare May 18, 2026 16:15
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed size: XS proof: sufficient ClawSweeper judged the real behavior proof convincing. labels May 18, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 18, 2026
@Takhoffman Takhoffman added proof: override Maintainer override for the external PR real behavior proof gate. proof: supplied External PR includes structured after-fix real behavior proof. labels May 18, 2026
@openclaw-barnacle openclaw-barnacle Bot removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. proof: supplied External PR includes structured after-fix real behavior proof. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels May 18, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels May 18, 2026
@clawsweeper

clawsweeper Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper 🐠 reef update

Thanks for the useful work here. ClawSweeper could not update this branch directly, so the replacement PR is the writable swim lane for the same fix path.

Why replacement: ClawSweeper could not update the source PR branch directly; GitHub did not grant sufficient push rights to the bot for that branch.
Replacement PR: #83691
Why close: this run explicitly closes the superseded source PR after the credited replacement PR is open, so review continues in one place.
This source PR is being closed only under the explicit source-close setting for this ClawSweeper run.
The original contribution stays credited in the replacement PR context.
Co-author credit kept:

fish notes: model gpt-5.5, reasoning high; reviewed against c6d9e29.

@clawsweeper clawsweeper Bot closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P2 Normal backlog priority with limited blast radius. proof: override Maintainer override for the external PR real behavior proof gate. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: /model picker auth label ignores auth.order resolution

2 participants