fix(claude): version slash/tilde aliases under claude-ocx2- - #761
Conversation
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughClaude Code aliasing now uses versioned v1 and v2 prefixes. Model IDs containing ChangesClaude alias versioning
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ClaudeCodeCLI
participant aliasForRoute
participant resolveAlias
ClaudeCodeCLI->>aliasForRoute: request v1 or v2 route alias
aliasForRoute-->>ClaudeCodeCLI: return encoded or plain alias
ClaudeCodeCLI->>resolveAlias: resolve selected alias
resolveAlias-->>ClaudeCodeCLI: return provider/model or native slug
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47a7a9134f
ℹ️ 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".
| **エイリアス構文ルール:** provider には `/` や `--` を含められず `native` と同じでもいけません。 | ||
| model ID には `/` を含められ、エイリアス内では `~s` として符号化します(例: `openrouter/anthropic/claude-opus-4-8` → | ||
| `claude-ocx-openrouter--anthropic~sclaude-opus-4-8`)。model ID のリテラル `~` は `~t` として符号化します。 | ||
| `claude-ocx2-openrouter--anthropic~sclaude-opus-4-8`)。model ID のリテラル `~` は `~t` として符号化します。 |
There was a problem hiding this comment.
Synchronize translated alias grammar with v2
The same partial edit in the Japanese, Korean, Russian, and Chinese pages changes only the slash example to claude-ocx2-, while each page's format table still says CLI aliases use only claude-ocx- and the surrounding text still implies ~s/~t are decoded without distinguishing v1 literal decoding from v2 escape decoding. Non-English users therefore receive internally inconsistent instructions and cannot determine which prefix to use; mirror the English page's plain-v1/escaped-v2 table and grammar in all four translations.
AGENTS.md reference: docs-site/AGENTS.md:L7-L10
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs-site/src/content/docs/guides/claude-code.md`:
- Around line 203-208: Correct the fallback sentence in the model alias
documentation so it reads “Routes that the readable form cannot express fall
back to the hashed alias.”
In `@docs-site/src/content/docs/ja/guides/claude-code.md`:
- Line 86: Update the CLI format table and grammar in
docs-site/src/content/docs/ja/guides/claude-code.md:86-86,
docs-site/src/content/docs/ko/guides/claude-code.md:121-121,
docs-site/src/content/docs/ru/guides/claude-code.md:91-91, and
docs-site/src/content/docs/zh-cn/guides/claude-code.md:93-93 to match the
English source, distinguishing plain v1 aliases from escaped v2 aliases and
documenting their decode rules: v1 preserves ~s/~t literally, while v2 expands
them. Ensure all localized guides consistently explain the compatibility
boundary and do not leave the claude-ocx2 examples implying v1-only syntax.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 44218ac0-9268-423f-a40d-287305141dbe
📒 Files selected for processing (7)
docs-site/src/content/docs/guides/claude-code.mddocs-site/src/content/docs/ja/guides/claude-code.mddocs-site/src/content/docs/ko/guides/claude-code.mddocs-site/src/content/docs/ru/guides/claude-code.mddocs-site/src/content/docs/zh-cn/guides/claude-code.mdsrc/claude/alias.tstests/claude-alias.test.ts
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
claude-ocx2-prefix so/→~sand~→~tcannot collide with legacyclaude-ocx-literals that already contained those two-char sequences.claude-ocx-(literal decode) for stability of existing picker selections.aliasForNativetilde round-trip coverage; update EN + locale docs for the v1/v2 grammar.Test plan
bun test ./tests/claude-alias.test.tsbun test ./tests/claude-inbound.test.ts ./tests/claude-models-discovery.test.ts ./tests/claude-model-info.test.tsbun x tsc --noEmitSummary by CodeRabbit
New Features
/or~, using a newclaude-ocx2-alias form./→~s,~→~t) for reliable alias generation and resolution.claude-ocx-(v1) aliases working for model IDs without/or~.Documentation
/modelselector guidance and examples to reflect v2 alias formats, decoding rules, and fallback behavior.Tests