Repository navigation
Conversation
…light Closes openclaw#182467 Project-attached sessions_spawn supplies the project workspaceDir to the read-only preflight. The exact and activation candidates both carry that workspace, so neither matches the configured owner published at the agent's workspace, and the preflight falls through to a runtime-free ephemeral catalog without provider plugin registries — rejecting plugin-resolved models (DeepSeek, native Haiku) as "Unknown" even though the configured owner knows them. Add a third read-only candidate that probes at the agent's known configured workspace with every other identity dimension preserved and env bound to the effective process environment so the resolver's env match stays exact.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR lets read-only model catalog requests fall back to an owner published at the agent's configured workspace. Example: A parent session in /work/project spawns deepseek/deepseek-flash while its agent inventory is published at /work/agent.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR open: it addresses a concrete catalog-owner mismatch, but the fallback can also substitute a standalone host's catalog across workspaces. Priority: P2 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe prepared catalog layer maps agent, workspace, configuration, and environment inputs to lifecycle-owned model inventory and runtime facts consumed by model selection and subagent preflight. flowchart TD
A[Project parent session] --> B[Spawn model preflight]
B --> C[Prepared catalog resolver]
C --> D[Requested workspace owner]
C --> E[Configured workspace fallback]
C --> F[Ephemeral read-only catalog]
D --> G[Model validation]
E --> G
F --> G
Technical reviewBest possible solution: Resolve Gateway inventory reuse through the existing publication owner while preserving exact standalone workspace selection and the session's execution directory. Do we have a high-confidence way to reproduce the issue? Source confirms that explicit project workspaces miss the configured publication and reach the ephemeral fallback; the linked report's fixture supports this mechanism, but a real Gateway reproduction of the reported installation remains unverified. Is this the best way to solve the issue? Reusing the existing Gateway inventory owner fits the documented contract, but changing the workspace before an unrestricted exact lookup is broader than the required repair. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8f4fe7407101. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +22, Tests +105. Total +127 across 2 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 25, 2026, 2:26 PM ET / 18:26 UTC. |
Additional live evidence (2026.10.9, Linux, native
|
| Phase | workspaceDir | Catalog used | claude-cli in authModes |
anthropic/* | xai/* |
|---|---|---|---|---|---|
| A (nothing published) | agent ws | ephemeral read-only | missing (only openai, xai) |
rejected, same error | resolved |
| A (nothing published) | subdir | ephemeral read-only | missing | rejected | resolved |
| B (owner published for agent ws only) | agent ws | published | present | resolved | resolved |
| B (owner published for agent ws only) | subdir | ephemeral read-only | missing | rejected | resolved |
Phase A shows that the failure follows the catalog kind, not the workspace: even the agent's own workspace fails when it falls through to the ephemeral read-only catalog. The ephemeral build drops the synthetic CLI-backend credential. Stored OAuth profiles survive, which is why xAI is unaffected. With the authModes["claude-cli"] entry missing, native availability evaluates to a definitive false.
This matches the mechanism described in #183761, where the read-only owner lookup misses the configured owner and falls back to a runtime-free ephemeral catalog. Reusing the configured-workspace owner should fix our case too. We have not tested the PR branch itself.
Minimal reproduction recipe (no project registration, no third-party provider plugin)
Note: this recipe is distilled from the live observations above. We have not re-run it from scratch on a clean installation, so treat it as the expected path rather than a verified one.
- Configure one agent
mainwithworkspace = W. We used a git repo with commits; whether that matters here is untested. - Route
anthropic/*throughagentRuntime.id = "claude-cli". Log in withclaudeon the host and do not add ananthropicauth profile. Optionally add any provider that uses a stored profile (e.g.xai) as a control. - Create a plain subdirectory
W/sub. Do not register it as a project. - Restart the Gateway so the configured owner for W is published.
- Start a new top-level session whose working directory is
W/sub(any client that lets you choose the session's working directory). Confirm thatsessions_listshowsworkspaceDir = W/subwith noprojectId. - In that session, call
sessions_spawnwithmodel: "anthropic/claude-haiku-5-5".- Actual:
sessions_spawn model "anthropic/claude-haiku-5-5" is not usable: The selected account or native runtime is unavailable … - Same session, control:
model: "xai/<any>"is accepted. - Separate control: repeat steps 5–6 with the working directory set to
W. The Anthropic spawn is accepted.
- Actual:
- Read-only cross-check without spawning:
models.listwith the failing session'ssessionKeylists the Anthropic models as available, so the rejection comes from the spawn preflight, not the inventory.
Running the same steps on a build of #183761 should give the after-fix Gateway proof requested in the review: step 6 should be accepted from W/sub.
|
Thank you, @ric03uec, for taking the time to develop the fix and regression tests, and @VQuesada for the independent live reproduction and detailed investigation. I originally reported this issue based on failures in my installation, and I appreciate the substantial work you've both contributed toward understanding and resolving it. I'm happy to leave the implementation and further validation to the contributors and maintainers. Thank you again! |
|
openclaw-182467-native-evidence-20261108.zip Reporter follow-up: operating Gateway red → restart-only red → forward-port green; P2-safe candidate and hosted CI limitationsI can now report successful real child execution from the original project-parent installation after applying a narrowly scoped candidate. I am the reporter of #182467. This is a version-specific 2026.10.10 compiled forward-port of the PR prerequisite plus the proposed Option 4 change, not a run of PR head 1. Live operating-Gateway result (2026-11-08 KST)Environment: one existing WSL-hosted OpenClaw 2026.10.10 Gateway (build-reported commit
Both after-patch calls used the same pre-existing project parent, project/workspace, requested IDs, exact prompt ( The unpatched restart-only control matters because restarting the Gateway with original file hashes did not clear the two preflight failures. During the later operator-controlled apply, the existing Gateway exited fully before two compiled Limits: The exact owner/provenance chosen at the failure instant was not logged; the successful sequence is a live forward-port test on 2026.10.10, not proof that PR head is production-green. Child process OS cwd, unrelated model/workspace cases and production standalone isolation were not fully measured. This does not fix the unrelated shutdown 2. Why the hosted GitHub Actions trials did not demonstrate this earlierWe used a separate temporary GitHub-hosted real Gateway through workflow Run #7, comparing base
The operating installation, unlike hosted CI, supplied a repeatable red baseline and then real replies after the narrow candidate. 3. Separate P2 reviewer blocker: standalone catalog isolationI also reproduced the P2 found in ClawSweeper's review on head The proposed small correction (Option 4, source diff in the attachment) is: - agentConfiguredWorkspaceDir !== full.workspaceDir
+ agentConfiguredWorkspaceDir !== full.workspaceDir &&
+ isPreparedModelRuntimeGatewayLifecycleActive()
? {
...full,
- workspaceDir: agentConfiguredWorkspaceDir,
+ workspaceDir: undefined,
env: full.env ?? process.env,
}It also adds a small exported read of the existing Gateway-lifecycle boolean. This preserves the intent of #169539: configured inventory is shareable across execution directories during Gateway lifecycle, while standalone discovery remains workspace-scoped. In the targeted harness, configured Gateway owner reuse remained 6/6, while standalone cross-workspace leakage dropped to 0/6 and non-Gateway configured sharing to 0/3. Selected local catalog/scoped-thinking tests reported 59/59 passing. This is targeted source-level evidence, not a full regression suite. A workspace-less standalone-owner/lifecycle-transition edge case and broader database-worker lanes still need examination. The assertion that a workspace-less probe always resolves only through configured provenance is not yet proven for every lifecycle history. 4. Files and requested next stepAttachment: Request to @ric03uec / maintainers: Please evaluate integrating a Gateway-scoped, standalone-isolating fallback (Option 4 or an equivalent implementation), replace mock-only owner assertions with real publication/selection coverage, and verify the additional edge cases/required integration tests. The live forward-port result addresses the original user-visible failure in its actual environment, while the remaining PR-head merge blockers still need source-level resolution. Once the PR's actual code and evidence have been updated, an authorized contributor can request Independent earlier pre-fix reproduction: VQuesada's Linux/Claude CLI report. Original report: #182467. |
Superseding fix merged upstream: #197238For visibility and to avoid duplicate work, #197238 has been merged into It fixes the same project-session read-only published-catalog lookup mismatch targeted by this draft PR. The merged version gates its workspace-less inventory candidate on an active Gateway lifecycle, preserving standalone workspace scoping, and adds owner-selection regression coverage. The author also reports project-session child execution in an isolated real Gateway with a stand-in discovery plugin. This appears to supersede the proposed fix in #183761, although my original Haiku 4.5 / DeepSeek Flash installation has not been re-tested on the merged upstream commit. My earlier operating-Gateway validation of a version-specific forward-port remains a separate data point. Thank you, @ric03uec, for the original fix and investigation, and to the other contributors. The PR author/maintainers may wish to close this draft as superseded after reviewing the overlap. |
|
This pull request has been automatically marked as stale after 7 days without qualifying human activity. |
|
Closing due to inactivity. |
Closes #182467
What Problem This Solves
Fixes: project-attached
sessions_spawnrejects a plugin-resolved child model (deepseek/*, nativeanthropic/claude-haiku-4-5) asUnknown modelorselected account or native runtime is unavailable, even though the agent's configured owner knows the model and a normal session on the same installation accepts it.User Impact
User impact: a Child spawned from a project-parent session resolves provider-plugin and native-runtime models the agent's configured owner already knows, without the operator having to detach the project or
/resetthe session.Why This Change Was Made
A project-parent read supplies the project workspace to
withPreparedModelCatalogOwner({ readOnly: true }).resolveReadOnlyPublishedModelCatalogOwnerbuilds two candidates (full,activationFull); both carry the explicit project workspace, so the resolver's exact-key lookup misses the single configured owner published at the agent's workspace. The configured-workspace fallback insideresolvePublishedOwneris also gated on strict workspace equality, so it misses too. The code then falls through toacquireReadOnlyPreparedModelRuntime, which builds a runtime-free ephemeral catalog without the provider plugin registry — the plugin'sresolveDynamicModelhook is never invoked and the model is reported as unknown.This change narrows the preflight to a third read-only candidate that probes at the agent's known configured workspace (resolved via
resolveAgentWorkspaceDir, not any arbitrary workspace) with every other identity dimension carried from the caller andenvbound to the effective process environment so the resolver's env match stays exact instead of degrading to the wildcard branch. If the configured workspace is not resolvable, the fallback is suppressed and the existing ephemeral read-only path takes over, preserving the prior behavior for that shape.Agent, agent-directory, inherited-auth, environment, and generation isolation are preserved exactly. Writable publications and non-read-only paths are unchanged.
Evidence
src/agents/prepared-model-catalog.test.ts:src/agents/prepared-model-catalog.test.tssrc/agents/prepared-model-runtime.owner-selection.test.tssrc/agents/model-runtime-choice.test.tssrc/agents/model-runtime-choice.native.test.tssrc/agents/subagents/spawn/subagent-spawn.workspace.test.tssrc/agents/openclaw-tools.subagents.sessions-spawn.plan.test.tsReview notes
Marked draft pending maintainer sign-off on scope. ATX reviews surfaced a residual architectural suggestion to gate configured-workspace reuse behind an explicit, validated project-parent predicate; introducing such a predicate expands scope beyond the acceptance criteria recorded in the issue's Codex review ("preserve agent, account, environment, and generation isolation"; "a focused inventory-owner correction"), so it is deferred.