[WRONG BRANCH] fix(cli): refuse ambiguous self-namespaced removals - #394
[WRONG BRANCH] fix(cli): refuse ambiguous self-namespaced removals#394luvs01 wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3171af201
ℹ️ 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".
| qualifiedModelId | ||
| && target !== qualifiedModelId | ||
| && admitted.has(target) | ||
| && existing.some(model => model.provider === selectedProvider && model.modelId === qualifiedModelId) |
There was a problem hiding this comment.
Resolve the full qualified collision class
When the self-namespaced ID contains another slash, this exact equality check misses an encoded qualified sibling. For example, the valid custom rows { provider: "acme", modelId: "acme/a/b" } and { provider: "acme", modelId: "a-b" } make models remove acme/a/b name the first row literally while its provider-qualified reading a/b is equivalent to the second row under resolveSlugSelection; because qualifiedModelId is a/b, this predicate finds no sibling and the command silently deletes the literal row instead of refusing the ambiguous destructive operation. Resolve the qualified reading through the shared resolver and admit its entire matched set rather than checking only exact modelId equality.
Useful? React with 👍 / 👎.
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
Motivation
<provider>/<modelId>selector can be read both as a provider-qualified target and as a literal self-namespaced native id.Description
src/cli/models.tsand treat a<provider>/<modelId>that names both a self-namespaced native id and a provider-qualified sibling as ambiguous rather than choosing the native interpretation.tests/cli-models.test.tsasserting thatmodels remove acme/turbo --yesfails as ambiguous when bothacme/turboandturboexist, while preserving the existing behavior for a sole self-namespaced row.Testing
node_modules/.bin/bun test tests/cli-models.test.ts tests/slug-codec.test.ts, and the affected tests passed (focused run: 59 tests across the two files passed).node_modules/.bin/bun run typecheck.node_modules/.bin/bun run testrun was started for broader verification but surfaced unrelated environment/concurrency failures; the focused tests and typecheck that verify this change succeeded.Codex Task