Add Telegram /login Codex pairing flow#98006
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 1, 2026, 12:58 PM ET / 16:58 UTC. Summary PR surface: Source +699, Tests +716, Docs +3, Config +8, Generated 0, Other +1. Total +1427 across 30 files. Reproducibility: not applicable. as a bug reproduction; this is a feature PR for channel-friendly Codex reauth. Source inspection confirms current main lacks the requested Review metrics: 2 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land only after maintainers either approve or demote the auth-login SDK surface and attach current-head Telegram proof for private code delivery plus group/topic no-code guidance. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction; this is a feature PR for channel-friendly Codex reauth. Source inspection confirms current main lacks the requested Is this the best way to solve the issue? Unclear: the implementation is a plausible narrow solution, but the best fix depends on maintainer acceptance of the public auth-login SDK surface and fresh proof of the Telegram privacy behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against db97bc1e4fcf. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +699, Tests +716, Docs +3, Config +8, Generated 0, Other +1. Total +1427 across 30 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be2d215c7a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Sick |
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIF evidence for the /login codex Telegram command.
Motion-trimmed clips: Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-98006/run-28425097948-1/index.json |
|
@clawsweeper re-review |
|
@openclaw-mantis telegram desktop proof: current head 1abfc15 needs complete /login codex privacy proof. Please capture all of these visible behaviors in the candidate run: (1) private Telegram DM /login codex emits the OpenAI verification URL/user code only in the private chat, with secret/code material redacted in the public artifact if required; (2) Telegram group /login codex shows DM/private-chat guidance and does not display a verification URL or user code; (3) Telegram topic/thread /login codex shows DM/private-chat guidance and does not display a verification URL or user code. Denial-only proof is insufficient for ClawSweeper. |
dcff6db to
b8a96f2
Compare
b8a96f2 to
0063b6e
Compare
|
Real Telegram E2E proof on PR head Default test bot was unavailable due a duplicate Passed:
Cleanup: temp gateway/mock stopped; no local pollers left running. |
|
Landed via rebase onto main.
Thanks @100yenadmin! |




Summary
/login codexfor Codex/OpenAI device-code pairing from channel surfaces.device-codeauth flow and profile persistence path through a reusable non-TTY login helper./login codexfrom a private chat or Web UI session while preserving the terminal fallback.What Problem This Solves
Codex/OpenAI OAuth expiry currently leaves channel-only or remote gateway operators with a terminal-only recovery path. When the user sends a normal message and the Codex token is expired, revoked, reused, or otherwise invalidated, the gateway now classifies that hard auth failure and replies with private
/login codexguidance instead of only a terminal command./login codexis explicit and owner/admin-gated. It sends the existing OpenAI Codex device-code URL/code only through private chat or Web UI response paths so the owner can pair a fresh Codex login from a browser without exposing tokens or auto-starting auth in shared channels.Supported Surfaces
/logincommand in private chat; group/topic invocations tell the owner to DM the bot and do not emit a device code.chat.sendand the shared reply dispatcher./loginregistration is intentionally not exposed in v1./loginregistration is intentionally not exposed in v1.Failure Flow
flowchart TD A["User sends normal request"] --> B["OpenClaw runs Codex/OpenAI model"] B --> C{"OAuth refresh succeeds?"} C -->|"yes"| D["Model reply continues normally"] C -->|"expired / revoked / token_invalidated / invalid_grant"| E["OAuth refresh failure classifier"] E --> F["Reply: send /login codex from a private chat or Web UI"] F --> I{"User is in Telegram group/topic?"} I -->|"yes"| J["/login replies: DM this bot to pair Codex"] I -->|"no, private path"| K["/login can show device URL/code"] B --> G{"Quota or rate limit?"} G -->|"yes"| H["Quota/rate-limit guidance, no reauth prompt"]Login Flow
Security / UX Notes
/login codex,/login openai, and/login openai-codexnormalize to provideropenaiand methoddevice-code.openclaw/plugin-sdk/provider-auth-login-flow-runtimesubpath, not the broadagent-runtimebarrel or the common provider-auth runtime import.Validation
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/test-projects.mjs src/auto-reply/reply/commands-login.test.ts src/auto-reply/commands-registry.test.ts src/plugins/commands.test.ts src/auto-reply/reply/agent-runner-execution.test.ts src/gateway/server-methods/commands.test.tsOPENCLAW_VITEST_MAX_WORKERS=1 node scripts/test-projects.mjs extensions/telegram/src/bot-native-commands.test.ts extensions/telegram/src/bot-native-commands.session-meta.test.tsOPENCLAW_VITEST_MAX_WORKERS=1 node scripts/test-projects.mjs test/scripts/plugin-sdk-surface-report.test.ts src/plugins/contracts/plugin-sdk-package-contract-guardrails.test.ts src/plugins/contracts/plugin-sdk-subpaths.test.ts src/plugins/contracts/plugin-sdk-runtime-api-guardrails.test.tsOPENCLAW_VITEST_MAX_WORKERS=1 node scripts/test-projects.mjs src/docs/slash-commands-doc.test.ts src/agents/auth-profiles/oauth-refresh-failure.test.tsnode scripts/check-extension-package-tsc-boundary.mjs --mode=compilenode scripts/check-plugin-sdk-subpath-exports.mjsnode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src.tsbuildinfonode scripts/check-extension-plugin-sdk-boundary.mjs --mode=plugin-sdk-internalnode scripts/check-deprecated-api-usage.mjsnode scripts/plugin-sdk-surface-report.mjs --check./node_modules/.bin/oxlint src/auto-reply/reply/commands-login.ts./node_modules/.bin/oxfmt --check --threads=1 <changed files>git diff --checkAdditional review follow-up:
runModelsAuthLoginFlowoffopenclaw/plugin-sdk/agent-runtimeand the common provider-auth runtime import, onto the lazyopenclaw/plugin-sdk/provider-auth-login-flow-runtimesubpath./loginto slash-command docs after CI caught the new built-in alias.qa-labCrabline inbound injection with the pinned Crabline manifest API after the extension package boundary compile exposed the stale call-site.origin/mainso the PR preserves the PR fix(codex): require admin for native controls #97952 Codex owner/operator.admin native-control and bound-turn authorization boundary.commands.listcoverage so/loginis not serialized as a Discord/Slack native command while it remains text-visible for private command paths.check-deprecated-api-usage, focused Vitest,tsgotest-src typecheck, formatter, and plugin SDK boundary validation after the SDK-boundary/docs changes.Evidence
/login codexon private Web UI, Discord, and Slack command surfaces./login codexsending the device-code message before completion, explicit owner-only rejection, private group rejection, session-pinned profile reauth, and active-flow dedupe.token_invalidated./login codexfrom a private chat or Web UI session.Notes
pnpm run test:extensions:package-boundary:compileattempted a non-TTY dependency purge locally, so validation used the underlying CI checker directly:node scripts/check-extension-package-tsc-boundary.mjs --mode=compile.Refs #97984