fix: model ref normalization, Vertex transport routing, symlink workspace dirs#84934
fix: model ref normalization, Vertex transport routing, symlink workspace dirs#84934cropsgg wants to merge 3 commits into
Conversation
- Use modelKey() for plugin LLM allowlist and fallback model refs so provider-qualified IDs are not double-prefixed in diagnostics (openclaw#84887) - Stop formatLiteralProviderPrefixedModelRef from re-prefixing refs that already include the provider segment - Route google-vertex models through Vertex transport based on provider, api, or aiplatform baseUrl instead of ADC preflight (openclaw#84804) - Skip Generative AI baseUrl normalization for explicit Vertex endpoints - Use fs.stat in ensureAbsoluteDirectory so symlinked workspace dirs work (openclaw#84696)
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. The linked bugs are source-reproducible on current main from the ad hoc model-ref concatenation, Google stream selection order, and PR rating Rank-up moves:
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. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Preserve explicit OpenAI-compatible Do we have a high-confidence way to reproduce the issue? Yes. The linked bugs are source-reproducible on current main from the ad hoc model-ref concatenation, Google stream selection order, and Is this the best way to solve the issue? No. The Label changes:
Label justifications:
Full review comments:
Overall correctness: patch is incorrect What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 66dcc4ee8fd1. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
I think the On this PR's current head But the existing literal-prefix picker coverage fails: node scripts/run-vitest.mjs src/commands/model-picker.test.ts -t 'literal double-prefix'That looks intentional in the existing NVIDIA / literal-prefix path:
One extra concern: the new helper test uses So if the goal here is only #84887's runtime LLM allowlist diagnostic, I think the safer fix is to drop the If the intended product change is to remove the NVIDIA-style literal double-prefix display everywhere, then this probably needs to be handled as a broader behavior change with the picker tests, docs, and After updating the branch, a fresh bot review should pick this up via the usual re-review flow. |
|
- Revert formatLiteralProviderPrefixedModelRef change; openclaw#84887 stays scoped to modelKey() in runtime LLM allowlist and gateway fallback paths only. - Remove synthetic openrouter helper test; NVIDIA literal-prefix picker behavior unchanged. - Parse Vertex baseUrl hostnames per manifest (exact + regional suffix), not substring. - Add negative tests for proxy paths and lookalike hosts.
|
Reopening — closed accidentally. |
|
Thanks — agreed. I reverted the formatLiteralProviderPrefixedModelRef hunk and removed the synthetic OpenRouter helper test in ac960cb. #84887 is now scoped to modelKey() in runtime-llm.runtime.ts and server-plugins.ts only. NVIDIA preserveLiteralProviderPrefix / literal double-prefix picker labels are unchanged (node scripts/run-vitest.mjs src/commands/model-picker.test.ts -t 'literal double-prefix' passes). I also tightened Vertex routing to parsed hostname matching per the manifest contract (not substring), with negative tests for proxy/lookalike URLs. @clawsweeper re-review when you have a moment. |
Widen isGoogleVertexBaseUrl to match GoogleProviderConfigLike.baseUrl so extension package-boundary typechecks pass in CI. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@clawsweeper re-review Head
Please re-rate with the updated proof section and exact head. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
Fixes three unrelated bugs (Closes #84887, #84804, #84696):
modelKey()so provider-qualified refs are not double-prefixed in policy errors (e.g. staysopenrouter/gpt-5.4-mini, notopenrouter/openrouter/...). Scoped to runtime/gateway allowlist paths only; does not change NVIDIApreserveLiteralProviderPrefixdisplay (nvidia/nvidia/...in model picker).google-vertexprovider returns 404 from Google when models are accessed viaopenclaw agent, but direct curl with same URL + ADC token works #84804 —google-vertexmodels route to Vertex transport whenprovider,api, or parsed hostname matches the manifest Vertex endpoint contract (aiplatform.googleapis.comor{region}-aiplatform.googleapis.com), not raw URL substring matching.ensureAbsoluteDirectoryusesfs.statso symlinked workspace directories are accepted.Motivation
modelIdalready contained a provider segment.google-vertexprovider returns 404 from Google when models are accessed viaopenclaw agent, but direct curl with same URL + ADC token works #84804: Vertex models withgoogle-generative-aiAPI could hit Generative AI transport and 404.memorywas a symlink to a real directory.Change Type
Scope
Linked Issue/PR
google-vertexprovider returns 404 from Google when models are accessed viaopenclaw agent, but direct curl with same URL + ADC token works #84804Real behavior proof
Behavior or issue addressed: Runtime LLM allowlist diagnostics double-prefix (#84887); Google Vertex transport mis-routing (#84804); write tool rejecting symlinked workspace dirs (#84696).
Real environment tested: macOS arm64, local checkout
cropsgg/openclawbranchfix/model-ref-vertex-fs-symlink, Node 22, repo dev dependencies installed.Exact steps or command run after this patch:
Evidence after fix (terminal transcript):
Observed result after fix: Literal-prefix picker labels still show
nvidia/nvidia/...as intended; Vertex proxy/lookalike base URLs are not classified as Vertex; symlinked dirs return{ ok: true }; allowlist denial usesopenrouter/gpt-5.5notopenrouter/openrouter/....What was not tested: Live gateway run with production Vertex ADC/API keys or full Lossless plugin overflow recovery end-to-end.
Before evidence (optional): Issue reports and ClawSweeper review on prior head documented failing picker expectation when
formatLiteralProviderPrefixedModelRefwas changed; reverted inac960cb7.Root Cause
`${provider}/${model}`afternormalizeModelRef, duplicating an already-qualifiedmodelId.google-vertexprovider returns 404 from Google when models are accessed viaopenclaw agent, but direct curl with same URL + ADC token works #84804:createStreamFnpreferredgoogle-generative-aibranch and gated Vertex on ADC preflight.ensureAbsoluteDirectoryusedlstatand rejected symlinks to directories.Regression Test Plan
runtime-llm.runtime.test.ts,provider-registration.test.ts,fs-safe.ensure-absolute-directory.test.ts,model-picker.test.ts(literal-prefix)User-visible / Behavior Changes
nvidia/nvidia/...).Test plan
node scripts/run-vitest.mjs src/commands/model-picker.test.ts -t 'literal double-prefix'node scripts/run-vitest.mjs extensions/google/provider-registration.test.tsnode scripts/run-vitest.mjs src/infra/fs-safe.ensure-absolute-directory.test.tsnode scripts/run-vitest.mjs src/plugins/runtime/runtime-llm.runtime.test.ts -t 'double-prefix'@clawsweeper re-review