Skip to content

fix(cli): resolve alias targets from the write snapshot - #128223

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
8exgh:fix/models-aliases-add-cas-snapshot
Aug 27, 2026
Merged

vincentkoc merged 2 commits into
openclaw:mainfrom
8exgh:fix/models-aliases-add-cas-snapshot

Conversation

@8exgh

@8exgh 8exgh commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #127618

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

openclaw models aliases add <alias> <model-or-alias> resolved the target before
updateConfig obtained the snapshot and hash that fence the write. If another
config writer remapped the input alias between those reads, the command
successfully attached the new alias to the stale model and logged that stale
target.

Why This Change Was Made

modelsAliasesAddCommand now resolves modelRaw inside the updateConfig
mutator from context.runtimeConfig. Resolution and the compare-and-swap write
therefore share one authoritative snapshot. The canonical model key is persisted
to the source config and retained for the post-commit success line.

No shared resolver, config shape, CLI flag, migration, fallback, or docs change
is included.

User Impact

  • models aliases add follows the alias mapping current at the fenced write.
  • The printed Alias <alias> -> <target> line matches the persisted target.
  • Runtime-only built-in aliases still resolve while only source-form config is
    written.

Evidence

AI-assisted (Claude Code and Codex); I have read and understand the change.

Red-before on current main

node scripts/run-vitest.mjs src/commands/models/aliases.test.ts

The reconstructed two-snapshot regression failed as intended: the stale
pre-snapshot mapped old-alias to openai/gpt-5.6-sol, the CAS snapshot mapped
it to anthropic/claude-opus-5, and pre-fix code wrote new-alias to the stale
OpenAI target. Result: 1 failed, 17 passed.

Focused owner and sibling tests

scripts/pr review-tests 128223 \
  src/commands/models/aliases.test.ts \
  src/commands/models/set.test.ts \
  src/commands/models/shared.test.ts \
  src/commands/models/fallbacks-shared.test.ts \
  src/commands/promos/claim.test.ts \
  src/commands/promos/list.test.ts

All requested files passed and were observed in the native review output.
pnpm check:changed and git diff --check also passed.

Autoreview

Fresh branch autoreview with Codex gpt-5.6-sol at high reasoning reported no
accepted or actionable findings; overall correctness confidence was 0.99.

Real CLI/config-I/O proof

Blacksmith Testbox lease tbx_01m118jw10zrx3x400tr2ten3b, Actions run
33058459463, executed the exact reviewed tree with an isolated config. An
external atomic writer moved old-alias from the OpenAI model to the Anthropic
model before the real CLI write:

SETUP dependency install and build passed
INITIAL old-alias -> openai/gpt-5.6-sol
WRITER old-alias -> anthropic/claude-opus-5
COMMAND models aliases add new-alias old-alias
Updated config: <PROOF_DIR>/openclaw.json
Alias new-alias -> anthropic/claude-opus-5
PERSISTED {"openai/gpt-5.6-sol":{"params":{"temperature":0.2}},"anthropic/claude-opus-5":{"alias":"new-alias"}}

The remote command and assertions exited 0.

Gate note

Local prepare-gates build and check passed. The full test encountered unrelated
tooling noise: telegram-user-crabbox-proof.test.ts reproduced the same failure
on current main, test-live.test.ts passed on current-main retry, and the
test-perf-budget.test.ts / test-projects.test.ts shard reproduced a no-output
hang on current main. An initial Blacksmith Testbox full-gate lease failed before
tests because its hydrated checkout lacked node_modules and could not import
tsx.

Exact-head CI run 33057073509 completed successfully with no failed jobs.
OPENCLAW_TESTBOX=1 scripts/pr prepare-run 128223 accepted that hosted proof and
completed with gates_mode=hosted_exact_or_recent_parent.

Repair Closeout

  • Root cause: aliases add resolved modelRaw before the CAS-owned config
    snapshot existed.
  • Owner: src/commands/models/aliases.ts.
  • Canonical fix: resolve inside updateConfig using context.runtimeConfig.
  • Sibling coverage: aliases, set, fallbacks-shared, shared, and promo command
    tests passed.
  • Production LOC: +6/-4, net +2.
  • Tests: +54/-0.
  • Effective diff: two files; src/commands/models/shared.ts is unchanged.

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@8exgh
8exgh marked this pull request as ready for review August 23, 2026 12:54
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S labels Aug 23, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. 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. labels Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 27, 2026, 5:14 AM ET / 09:14 UTC.

ClawSweeper review

What this changes

Moves models aliases add target resolution into the hash-fenced configuration write snapshot and adds regressions for concurrent remapping and runtime-only aliases.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

The patch is correct and fixes a current-main stale-target race, but this external PR still needs real configuration/CLI proof beyond mocked Vitest coverage before merge.

Priority: P2
Reviewed head: 2f5af3ed806d65e92e605fcd9a61c27c8ded74e9

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The owner-boundary repair is sound, but real after-fix behavior proof is still required for this external PR.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The reported red-before and after-fix evidence is a Vitest test with mocked snapshot and write functions, not an observed real CLI/config-I/O run; add redacted real behavior proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The reported red-before and after-fix evidence is a Vitest test with mocked snapshot and write functions, not an observed real CLI/config-I/O run; add redacted real behavior proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Current-main defect: Current main resolves the model argument before entering the separately snapshotting configuration update, allowing a remap between those reads to select a stale target.
Write-boundary repair: The PR resolves from the runtime form supplied by the same update snapshot, mutates only the paired source form, and retains the canonical target only for post-write logging.
Configuration contract: The shared owner clones source and runtime configurations from one valid snapshot and passes that snapshot hash to the replacement write; the underlying writer rejects a changed base hash before writing.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/commands/models/aliases.test.ts

Result: PASS (completed)

[test] starting test/vitest/vitest.commands.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-128223-Fl631d/target

 ✓  commands  src/commands/models/aliases.test.ts (19 tests) 915ms
     ✓ does not make an unlisted model override invalid on a fresh config  317ms

 Test Files  1 passed (1)
      Tests  19 passed (19)
   Start at  09:15:31
   Duration  9.68s (transform 6.91s, setup 970ms, import 7.49s, tests 915ms, environment 0ms)

[test] passed 1 Vitest shard in 15.68s

Assertions:

  • PASS expect_output: Test Files

How this fits together

The models CLI resolves a model reference and writes a global aliases map through a hash-fenced configuration update. The resolved target is persisted in source config and then shown in the command’s success output.

flowchart LR
  A[Alias add command] --> B[Read config snapshot]
  B --> C[Materialize runtime aliases]
  C --> D[Resolve requested target]
  D --> E[Hash-fenced source write]
  E --> F[Success message]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The reported red-before and after-fix evidence is a Vitest test with mocked snapshot and write functions, not an observed real CLI/config-I/O run; add redacted real behavior proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The cited after-fix evidence is a Vitest suite that mocks both configuration snapshot reads and writes, so it does not demonstrate the actual CLI/config-I/O path.
  • Resolve merge risk (P1) - Production code grows by two lines for the callback-derived canonical target; the small growth is justified because the shared update API returns only config while the post-commit message must report the resolved target.
Agent review details

Security

None.

PR surface

Source +2, Tests +54. Total +56 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 6 4 +2
Tests 1 54 0 +54
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 60 4 +56

Review metrics

Metric Value Why it matters
Production vs. regression coverage production +2 net (6 added, 4 removed); tests +54 The small production increase retains the resolved target for the post-commit result while the tests cover both snapshot consistency and source-only persistence.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #127618
Summary: This PR explicitly implements the concrete stale-alias race tracked by the canonical issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Add real write-path proof (recommended)
    Show a redacted after-fix CLI or real configuration-I/O run covering the write-time alias remap before merging.

Technical review

Best possible solution:

Keep resolution and the fenced write on one snapshot, then add redacted real CLI/config-I/O proof that a write-time remap persists and reports the same canonical target.

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

Yes. The divergent-snapshot regression is a high-confidence deterministic reproduction, and current-main source confirms its pre-write resolution path; it was not executed in this read-only review.

Is this the best way to solve the issue?

Yes. Resolving inside the existing snapshot owner is the narrow canonical repair, matching the models set write boundary without adding configuration or fallback surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 049f4940b9f9.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The reported red-before and after-fix evidence is a Vitest test with mocked snapshot and write functions, not an observed real CLI/config-I/O run; add redacted real behavior proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove proof: sufficient: Current real behavior proof status is mock_only, not sufficient.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P2: This repairs a bounded global CLI configuration race with limited user blast radius.
  • merge-risk: 🚨 compatibility: The command now resolves existing aliases at the write snapshot rather than from an earlier configuration load.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The reported red-before and after-fix evidence is a Vitest test with mocked snapshot and write functions, not an observed real CLI/config-I/O run; add redacted real behavior proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main defect: Current main resolves the model argument before entering the separately snapshotting configuration update, allowing a remap between those reads to select a stale target. (src/commands/models/aliases.ts:58, 049f4940b9f9)
  • Write-boundary repair: The PR resolves from the runtime form supplied by the same update snapshot, mutates only the paired source form, and retains the canonical target only for post-write logging. (src/commands/models/aliases.ts:59, 2f5af3ed806d)
  • Configuration contract: The shared owner clones source and runtime configurations from one valid snapshot and passes that snapshot hash to the replacement write; the underlying writer rejects a changed base hash before writing. (src/commands/models/shared.ts:59, 049f4940b9f9)
  • Regression coverage: The new divergent-snapshot test checks the fenced hash, current target, preserved sibling parameters, and reported target; the second test verifies runtime-only alias resolution is not serialized to source config. (src/commands/models/aliases.test.ts:383, 2f5af3ed806d)
  • Sibling/default behavior: models set already resolves from the update snapshot, while default materialization preserves an explicitly authored case-folded alias instead of overwriting it with a built-in alias. (src/commands/models/shared.ts:291, 049f4940b9f9)
  • Feature history: Blame attributes the current pre-snapshot command implementation to Vincent Koc; the exact-head repair is also authored by Vincent Koc. Deeper history is unavailable in this promisor checkout because required objects could not be fetched. (src/commands/models/aliases.ts:58, 2f5af3ed806d)

Likely related people:

  • vincentkoc: Current-main blame identifies Vincent Koc on the affected command implementation, and Vincent authored the exact re-reviewed repair commit. (role: recent area contributor; confidence: high; commits: 2f5af3ed806d; files: src/commands/models/aliases.ts, src/commands/models/shared.ts)
  • steipete: Merged PR fix(cli): restore accurate operator diagnostics and safe input handling #116652 introduced the adjacent case-folded alias-collision behavior retained by this repair. (role: adjacent feature contributor; confidence: medium; commits: 467f072f231b; files: src/commands/models/aliases.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted terminal output from a real CLI or configuration-I/O run that proves a write-time remap persists and reports the current target.
  • After updating the PR body with that proof, request @clawsweeper re-review if a fresh review is not triggered automatically.

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.

History

Review history (7 earlier review cycles)
  • reviewed 2026-08-23T13:00:03.123Z sha 42f77d908ecfbbc2958dcdbcf0e9ea0a85e4a433 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-23T13:13:42.504Z sha b254fc445601d7fc80bb44e2e6a81ce887573ca5 :: needs changes before merge. :: [P2] Split the audit timing change from this alias repair
  • reviewed 2026-08-23T13:35:41.983Z sha 6a34bbee3f09677e2d4085df1165de1a1ecf54be :: needs maintainer review before merge. :: none
  • reviewed 2026-08-23T13:54:19.749Z sha 01d7ef51ec9fa22790a398586253dae56f038e41 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-24T11:20:24.490Z sha 6292c9248595c0d778c9a4237d6d222a0646f354 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-25T13:53:25.954Z sha 6292c9248595c0d778c9a4237d6d222a0646f354 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-26T07:46:18.315Z sha 93995a0 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 Aug 23, 2026
@8exgh
8exgh force-pushed the fix/models-aliases-add-cas-snapshot branch from b254fc4 to 6a34bbe Compare August 23, 2026 13:28
@8exgh

8exgh commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

Applied the ClawSweeper finding: the audit event-loop probe tolerance change is removed from this PR (head is now the alias fix only, 6a34bbee3f0, identical content to the originally reviewed 42f77d908ec). The flake fix is proposed separately in #128228 with its own focused validation.

@clawsweeper clawsweeper Bot added 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 23, 2026
@8exgh
8exgh force-pushed the fix/models-aliases-add-cas-snapshot branch from 6a34bbe to 01d7ef5 Compare August 23, 2026 13:46
@8exgh

8exgh commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

CI status on head 01d7ef51ec9 (alias fix only): the single red shard is again checks-node-compact-large-6 → src/audit/audit-event-writer.test.ts > keeps a cold owner open nonblocking under a held write lock, expected 278.6432880000066 to be less than 250 (run 32643396362). That is the same unrelated event-loop timing probe that failed on the first run (275.1 ms); the only fully green run on this PR was the head that also carried the tolerance change (b254fc44560). Two hits in three runs for this shard.

The fix for that probe is #128228 (green). Suggest landing #128228 first and re-running this PR's CI, or treating the remaining red as the known flake — maintainers' call. No code changes here since ClawSweeper's reviewed head; content is identical to 42f77d908ec.

@8exgh

8exgh commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready status for head 6292c924859.

Rebased onto current main (d9165f9813f). The flaky checks-node-compact-large-6 shard that was the only red on the previous head is resolved on main by #128228, so this run is clean:

  • Exact-head CI: run 32720757070 → success, 206 checks green, 0 failing.
  • pnpm test src/commands/models/aliases.test.ts src/commands/models/set.test.ts src/commands/models/shared.test.ts src/commands/models/fallbacks-shared.test.ts src/commands/promos → Test Files 6 passed (6), Tests 53 passed (53).
  • pnpm check:changed → exit 0; git diff --check clean.
  • Diff unchanged by the rebase: src/commands/models/aliases.ts (+16/−9), src/commands/models/shared.ts (+9/−3), src/commands/models/aliases.test.ts (+71). Production net +13.

The review's remaining item is the maintainer decision it names: whether to accept that aliases add now resolves an authored alias ahead of a same-named runtime-materialized built-in, matching what models set already does. That alignment is the intended behavior change, and the two-snapshot regression plus the keeps authored aliases ahead of runtime-only aliases case cover it.

No proof gaps known.

…remapped concurrently

`openclaw models aliases add <alias> <model-or-alias>` resolved its
`<model-or-alias>` argument from the config loaded at command start, then
entered `updateConfig`, which takes a fresh snapshot and fences the write
on that snapshot's hash. When another writer remapped the source alias in
between, the hash check still passed and the new alias was attached to the
model the argument no longer denoted, and the success line reported that
stale target.

Resolve the argument inside the fenced mutator from the same snapshot that
guards the write, using the resolver `models set` already uses (authored
source aliases first, runtime-materialized built-in aliases second), and
drop the pre-CAS read. This also aligns `aliases add` with `models set`
when an authored alias shares a name with a built-in one.

Closes openclaw#127618

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JisrS8fiHvELHvmi7iabZ9
@8exgh
8exgh force-pushed the fix/models-aliases-add-cas-snapshot branch from 6292c92 to 93995a0 Compare August 26, 2026 07:39
@8exgh

8exgh commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (2941b3d779f) to clear a merge conflict. Head is now 93995a08427; CI green again.

The conflict was semantic, not textual, so flagging the resolution for reviewers: #116652 added case-folded alias-collision detection to modelsAliasesAddCommand (normalizedAlias) in the same function this PR moves resolution out of. Both changes are kept — the case-folded uniqueness guard now runs inside the CAS-fenced mutator, against the target resolved from that same snapshot:

const normalizedAlias = alias.toLowerCase();
let target: string | undefined;
await updateConfig((cfg, context) => {
  const resolved = resolveModelTargetForWrite({ cfg, resolveCfg: context.runtimeConfig, modelRaw });
  const modelKey = `${resolved.provider}/${resolved.model}`;
  target = modelKey;
  // ... existing case-folded collision check, unchanged

The test file conflict was additive (both sides appended cases); both sets are kept.

Proof on 93995a08427:

Diff vs main is unchanged in shape: production +13 net, tests +71. No proof gaps known.

@vincentkoc vincentkoc changed the title fix(cli): models aliases add targets a stale model when the alias is remapped concurrently [AI-assisted] fix(cli): resolve alias targets from the write snapshot Aug 27, 2026
@vincentkoc vincentkoc self-assigned this Aug 27, 2026
@vincentkoc

Copy link
Copy Markdown
Member

@clawsweeper re-review

Fresh reviewed head: 2f5af3ed806d65e92e605fcd9a61c27c8ded74e9.

Rank-up handling:

  • Skipped the authored-versus-materialized same-name collision decision and
    removed its test/shared resolver. That production state is impossible:
    src/config/defaults.ts:449-456 checks existing normalized alias ownership
    and skips materializing a built-in target when another model already owns the
    alias.
  • The final fix is limited to resolving modelRaw from
    context.runtimeConfig inside the CAS-fenced updateConfig mutator.
  • Effective diff: production +6/-4 (net +2), tests +54/-0, two files.
  • Genuine red-before: the deterministic stale-remap regression failed on
    current main for the intended stale-target write.
  • Focused aliases/set/shared/fallbacks/promos tests passed.
  • pnpm check:changed, git diff --check, and fresh branch autoreview passed;
    autoreview reported no actionable findings.

The prior review is older than 12 hours and the behavior/scope changed
materially, so please review the exact current head.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed 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. labels Aug 27, 2026
@vincentkoc

Copy link
Copy Markdown
Member

@clawsweeper re-review

Added exact-head real CLI/config-I/O proof to the PR body.

Blacksmith Testbox lease tbx_01m118jw10zrx3x400tr2ten3b (Actions run
33058459463) installed and built the reviewed tree, atomically remapped
old-alias from openai/gpt-5.6-sol to
anthropic/claude-opus-5, then ran the real CLI:

INITIAL old-alias -> openai/gpt-5.6-sol
WRITER old-alias -> anthropic/claude-opus-5
COMMAND models aliases add new-alias old-alias
Alias new-alias -> anthropic/claude-opus-5
PERSISTED {"openai/gpt-5.6-sol":{"params":{"temperature":0.2}},"anthropic/claude-opus-5":{"alias":"new-alias"}}

The remote command and assertions exited 0. Exact-head CI run 33057073509
also completed successfully, and native
OPENCLAW_TESTBOX=1 scripts/pr prepare-run 128223 passed.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc
vincentkoc merged commit 88062ad into openclaw:main Aug 27, 2026
199 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
)

* fix(cli): models aliases add targets a stale model when the alias is remapped concurrently

`openclaw models aliases add <alias> <model-or-alias>` resolved its
`<model-or-alias>` argument from the config loaded at command start, then
entered `updateConfig`, which takes a fresh snapshot and fences the write
on that snapshot's hash. When another writer remapped the source alias in
between, the hash check still passed and the new alias was attached to the
model the argument no longer denoted, and the success line reported that
stale target.

Resolve the argument inside the fenced mutator from the same snapshot that
guards the write, using the resolver `models set` already uses (authored
source aliases first, runtime-materialized built-in aliases second), and
drop the pre-CAS read. This also aligns `aliases add` with `models set`
when an authored alias shares a name with a built-in one.

Closes openclaw#127618

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JisrS8fiHvELHvmi7iabZ9

* fix(cli): resolve alias targets from write snapshot

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

models aliases add resolves its target before the CAS-owned config snapshot

2 participants