Repository navigation
fix: keep your account's model access in managed worktrees and other workspaces - #207277
Conversation
… facts - A non-configured owner for another workspace of the same agent is offered the configured owner's catalog inventory; the existing per-provider source and credential guards decide which rows hold. The seed applies only for an identical plugin set. - Worktree turns (subagent reports, children, cron, compaction) now see the same account facts as the main workspace, so the access check no longer refuses a program the credential advertises. The access check is unchanged. - findConfiguredOwnerCandidates moves unchanged to a sibling module (owner line cap).
|
🦞👀 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. |
- Split the seed off before callbacks capture the catalog-access params, so a workspace runtime never pins the configured owner's inventory; retention reads it once.
…tial identity - A second stored account, a signed-out credential, a different direct key and a rotated credential never inherit another credential's advertised outcomes; a turn pinned to the pre-rotation generation is refused.
|
Codex review: passed. What this changesThis PR seeds workspace-scoped model inventories from the configured agent’s inventory when plugin identity, provider source, and credentials match. Example: Agent pro uses key-a, and a subagent reports into its parent’s managed worktree with the same credential.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR addresses a source-confirmed loss of account facts in workspace-scoped runtimes that remains on main; no definite introduced production defect was found. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherPrepared model runtimes combine agent configuration, credentials, plugin generations, and discovered catalogs into workspace-scoped snapshots consumed by model selection and inference admission. flowchart TD
A[Configured agent inventory] --> C[Retention guards]
B[Workspace credentials and plugins] --> C
C --> D[Workspace runtime snapshot]
D --> E[Existing access program check]
E --> F[Model request]
Technical reviewBest possible solution: Keep the seed in the existing runtime publication and retention owners, preserving credential isolation and workspace-specific plugin selection. Do we have a high-confidence way to reproduce the issue? Source traces the failure from workspace-keyed ownership through static run preparation to missing provider outcomes consumed by the access check; the author also reports a base-failing Gateway fixture, but this review ran no target code. Is this the best way to solve the issue? This is a focused repair at the existing inventory owner: it reuses established identity guards, preserves workspace isolation, and separates the seed from persistent callback captures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5f6a68b9b13c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +22, Tests +165. Total +187 across 7 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 November 28, 2026, 2:02 AM ET / 07:02 UTC. |
|
Landed.
|
…workspaces (openclaw#207277) ## What Problem This Solves A chat can require an OpenAI access program that the account offers. When that chat's session is bound to a managed worktree, turns that run in the worktree (for example, a subagent reporting back to its parent) were refused before any model request with "This … program is not advertised for the current account, model, and runtime". The same account in the same chat passed for ordinary messages. Users saw subagent results fail to come back. ## User Impact Turns that run in a workspace other than the agent's main one (managed worktrees, child sessions, cron jobs with a workspace, compaction with a requested workspace) now see the same account facts as the main workspace. The access check is unchanged: a program is still allowed only when the account's current credential advertises it, and no request reaches a model without it. ## Why This Change Was Made The facts an account is offered (`providerOutcomes`) belong to the agent and its credential, not to a directory. They live in the prepared catalog inventory, and every inventory row is already guarded per provider: a source fingerprint (provider config including the resolved key, the providing plugins' versions and install hashes, auth profiles and order, env) plus the credential identity. But the inventory was stored per catalog owner, and owners are keyed by workspace because a workspace can add plugins. So an owner for a second workspace started empty, and in static mode (turns never rediscover) it had no account facts. Only `chat.send` avoided this, because it deliberately prepares its catalog from the main workspace. Now a non-configured owner is offered the configured owner's inventory for the same agent, and the existing retention guards decide which rows hold for its own config and credentials. The seed is used only when the plugin set matches exactly (a workspace plugin could otherwise provide the same provider id with different code). The owner key, plugins and models stay per workspace. The seed applies at retention time, so a rejected seed does not hide the provider's generated models. Named edges, not coded: - If the configured owner has recorded discovery failures, a seeded worktree run owner retries that discovery until its lease ends. - Before the configured owner's first discovery, or right after a provider config or sign-in change and before rediscovery completes, a worktree turn can still be refused. A main-workspace turn recovers on rediscovery. This is not a regression. ## Evidence - New `prepared-model-runtime.workspace-inventory.test.ts`. Each case prepares the worktree turn with the dispatch's plugin generation, as report turns are prepared. The entitlement is keyed by account and credential identity: - `gives a worktree run with the same direct key only the account facts of its own credential` and `… with the same stored account …` see the main workspace's outcomes. Both fail on the merge base (`[]`). - `… with a different direct key …`, `… with a second stored account …` and `… with a signed-out credential …` inherit nothing. - `drops the account facts on the next worktree turn after the credential rotates`: after a sign-in change, a turn pinned to the old generation is refused ("superseded"), and the next turn sees no old-account facts. - The negative cases pass on the merge base by construction, since it never shares facts. With the retention credential guard disabled, the second-account, signed-out and rotation cases fail. The direct-key case is caught separately by the provider-config fingerprint, which includes the resolved key. - Real in-process Gateway fixture (synthetic HTTP only; not committed because it clones the repository): `chat.send` and then a requester-settle completion into a parent bound to a real managed worktree. Merge base: the ordinary turn passes and the completion is refused (`OPENAI_ACCESS_PROGRAM_UNAVAILABLE`, not advertised). This branch: both pass. The worktree-bound `chat.send` turn passes on both. - Prepared model runtime, prepared model catalog and access-program suites plus every direct importer of the changed files: 64 files, all pass, re-run after merging current main. - `findConfiguredOwnerCandidates` moved unchanged to `prepared-model-runtime.configured-owner.ts` so the owner module stays within its line cap. - Production (read-only): every refusal of this kind came from a session bound to a managed worktree. Each worktree was created minutes to hours before the first refusal, and none of those sessions ever had a successful report. Co-authored-by: Ayaan Zaidi <[email protected]>
…workspaces (#207277) ## What Problem This Solves A chat can require an OpenAI access program that the account offers. When that chat's session is bound to a managed worktree, turns that run in the worktree (for example, a subagent reporting back to its parent) were refused before any model request with "This … program is not advertised for the current account, model, and runtime". The same account in the same chat passed for ordinary messages. Users saw subagent results fail to come back. ## User Impact Turns that run in a workspace other than the agent's main one (managed worktrees, child sessions, cron jobs with a workspace, compaction with a requested workspace) now see the same account facts as the main workspace. The access check is unchanged: a program is still allowed only when the account's current credential advertises it, and no request reaches a model without it. ## Why This Change Was Made The facts an account is offered (`providerOutcomes`) belong to the agent and its credential, not to a directory. They live in the prepared catalog inventory, and every inventory row is already guarded per provider: a source fingerprint (provider config including the resolved key, the providing plugins' versions and install hashes, auth profiles and order, env) plus the credential identity. But the inventory was stored per catalog owner, and owners are keyed by workspace because a workspace can add plugins. So an owner for a second workspace started empty, and in static mode (turns never rediscover) it had no account facts. Only `chat.send` avoided this, because it deliberately prepares its catalog from the main workspace. Now a non-configured owner is offered the configured owner's inventory for the same agent, and the existing retention guards decide which rows hold for its own config and credentials. The seed is used only when the plugin set matches exactly (a workspace plugin could otherwise provide the same provider id with different code). The owner key, plugins and models stay per workspace. The seed applies at retention time, so a rejected seed does not hide the provider's generated models. Named edges, not coded: - If the configured owner has recorded discovery failures, a seeded worktree run owner retries that discovery until its lease ends. - Before the configured owner's first discovery, or right after a provider config or sign-in change and before rediscovery completes, a worktree turn can still be refused. A main-workspace turn recovers on rediscovery. This is not a regression. ## Evidence - New `prepared-model-runtime.workspace-inventory.test.ts`. Each case prepares the worktree turn with the dispatch's plugin generation, as report turns are prepared. The entitlement is keyed by account and credential identity: - `gives a worktree run with the same direct key only the account facts of its own credential` and `… with the same stored account …` see the main workspace's outcomes. Both fail on the merge base (`[]`). - `… with a different direct key …`, `… with a second stored account …` and `… with a signed-out credential …` inherit nothing. - `drops the account facts on the next worktree turn after the credential rotates`: after a sign-in change, a turn pinned to the old generation is refused ("superseded"), and the next turn sees no old-account facts. - The negative cases pass on the merge base by construction, since it never shares facts. With the retention credential guard disabled, the second-account, signed-out and rotation cases fail. The direct-key case is caught separately by the provider-config fingerprint, which includes the resolved key. - Real in-process Gateway fixture (synthetic HTTP only; not committed because it clones the repository): `chat.send` and then a requester-settle completion into a parent bound to a real managed worktree. Merge base: the ordinary turn passes and the completion is refused (`OPENAI_ACCESS_PROGRAM_UNAVAILABLE`, not advertised). This branch: both pass. The worktree-bound `chat.send` turn passes on both. - Prepared model runtime, prepared model catalog and access-program suites plus every direct importer of the changed files: 64 files, all pass, re-run after merging current main. - `findConfiguredOwnerCandidates` moved unchanged to `prepared-model-runtime.configured-owner.ts` so the owner module stays within its line cap. - Production (read-only): every refusal of this kind came from a session bound to a managed worktree. Each worktree was created minutes to hours before the first refusal, and none of those sessions ever had a successful report. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 3b899c3) Co-authored-by: RomneyDa <[email protected]>
…workspaces (#207277) A chat can require an OpenAI access program that the account offers. When that chat's session is bound to a managed worktree, turns that run in the worktree (for example, a subagent reporting back to its parent) were refused before any model request with "This … program is not advertised for the current account, model, and runtime". The same account in the same chat passed for ordinary messages. Users saw subagent results fail to come back. Turns that run in a workspace other than the agent's main one (managed worktrees, child sessions, cron jobs with a workspace, compaction with a requested workspace) now see the same account facts as the main workspace. The access check is unchanged: a program is still allowed only when the account's current credential advertises it, and no request reaches a model without it. The facts an account is offered (`providerOutcomes`) belong to the agent and its credential, not to a directory. They live in the prepared catalog inventory, and every inventory row is already guarded per provider: a source fingerprint (provider config including the resolved key, the providing plugins' versions and install hashes, auth profiles and order, env) plus the credential identity. But the inventory was stored per catalog owner, and owners are keyed by workspace because a workspace can add plugins. So an owner for a second workspace started empty, and in static mode (turns never rediscover) it had no account facts. Only `chat.send` avoided this, because it deliberately prepares its catalog from the main workspace. Now a non-configured owner is offered the configured owner's inventory for the same agent, and the existing retention guards decide which rows hold for its own config and credentials. The seed is used only when the plugin set matches exactly (a workspace plugin could otherwise provide the same provider id with different code). The owner key, plugins and models stay per workspace. The seed applies at retention time, so a rejected seed does not hide the provider's generated models. Named edges, not coded: - If the configured owner has recorded discovery failures, a seeded worktree run owner retries that discovery until its lease ends. - Before the configured owner's first discovery, or right after a provider config or sign-in change and before rediscovery completes, a worktree turn can still be refused. A main-workspace turn recovers on rediscovery. This is not a regression. - New `prepared-model-runtime.workspace-inventory.test.ts`. Each case prepares the worktree turn with the dispatch's plugin generation, as report turns are prepared. The entitlement is keyed by account and credential identity: - `gives a worktree run with the same direct key only the account facts of its own credential` and `… with the same stored account …` see the main workspace's outcomes. Both fail on the merge base (`[]`). - `… with a different direct key …`, `… with a second stored account …` and `… with a signed-out credential …` inherit nothing. - `drops the account facts on the next worktree turn after the credential rotates`: after a sign-in change, a turn pinned to the old generation is refused ("superseded"), and the next turn sees no old-account facts. - The negative cases pass on the merge base by construction, since it never shares facts. With the retention credential guard disabled, the second-account, signed-out and rotation cases fail. The direct-key case is caught separately by the provider-config fingerprint, which includes the resolved key. - Real in-process Gateway fixture (synthetic HTTP only; not committed because it clones the repository): `chat.send` and then a requester-settle completion into a parent bound to a real managed worktree. Merge base: the ordinary turn passes and the completion is refused (`OPENAI_ACCESS_PROGRAM_UNAVAILABLE`, not advertised). This branch: both pass. The worktree-bound `chat.send` turn passes on both. - Prepared model runtime, prepared model catalog and access-program suites plus every direct importer of the changed files: 64 files, all pass, re-run after merging current main. - `findConfiguredOwnerCandidates` moved unchanged to `prepared-model-runtime.configured-owner.ts` so the owner module stays within its line cap. - Production (read-only): every refusal of this kind came from a session bound to a managed worktree. Each worktree was created minutes to hours before the first refusal, and none of those sessions ever had a successful report. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 3b899c3) Follow-ups: 7b0b2e3 refactor(auth): keep published store lookup passive (#200185) [not selected for this narrow backport] Release adaptation: Use the shared configured-owner resolver and inventory seed while preserving stable publication imports and account/provider fences. (cherry picked from commit 740a1a4a0ce093185bdcf1b1f024d3d3dbabc16f) Companion audit: 7b0b2e3 is broader passive auth-store refactoring, not required; focused inventory and retention gates pass on stable publication owners. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
A chat can require an OpenAI access program that the account offers. When that chat's session is bound to a managed worktree, turns that run in the worktree (for example, a subagent reporting back to its parent) were refused before any model request with "This … program is not advertised for the current account, model, and runtime". The same account in the same chat passed for ordinary messages. Users saw subagent results fail to come back.
User Impact
Turns that run in a workspace other than the agent's main one (managed worktrees, child sessions, cron jobs with a workspace, compaction with a requested workspace) now see the same account facts as the main workspace. The access check is unchanged: a program is still allowed only when the account's current credential advertises it, and no request reaches a model without it.
Why This Change Was Made
The facts an account is offered (
providerOutcomes) belong to the agent and its credential, not to a directory. They live in the prepared catalog inventory, and every inventory row is already guarded per provider: a source fingerprint (provider config including the resolved key, the providing plugins' versions and install hashes, auth profiles and order, env) plus the credential identity. But the inventory was stored per catalog owner, and owners are keyed by workspace because a workspace can add plugins. So an owner for a second workspace started empty, and in static mode (turns never rediscover) it had no account facts. Onlychat.sendavoided this, because it deliberately prepares its catalog from the main workspace.Now a non-configured owner is offered the configured owner's inventory for the same agent, and the existing retention guards decide which rows hold for its own config and credentials. The seed is used only when the plugin set matches exactly (a workspace plugin could otherwise provide the same provider id with different code). The owner key, plugins and models stay per workspace. The seed applies at retention time, so a rejected seed does not hide the provider's generated models.
Named edges, not coded:
Evidence
prepared-model-runtime.workspace-inventory.test.ts. Each case prepares the worktree turn with the dispatch's plugin generation, as report turns are prepared. The entitlement is keyed by account and credential identity:gives a worktree run with the same direct key only the account facts of its own credentialand… with the same stored account …see the main workspace's outcomes. Both fail on the merge base ([]).… with a different direct key …,… with a second stored account …and… with a signed-out credential …inherit nothing.drops the account facts on the next worktree turn after the credential rotates: after a sign-in change, a turn pinned to the old generation is refused ("superseded"), and the next turn sees no old-account facts.chat.sendand then a requester-settle completion into a parent bound to a real managed worktree. Merge base: the ordinary turn passes and the completion is refused (OPENAI_ACCESS_PROGRAM_UNAVAILABLE, not advertised). This branch: both pass. The worktree-boundchat.sendturn passes on both.findConfiguredOwnerCandidatesmoved unchanged toprepared-model-runtime.configured-owner.tsso the owner module stays within its line cap.