Repository navigation
fix(agents): keep isolated completion config and credentials together - #139607
Conversation
Capture call-owned model/profile/sampling choices and validator/cancellation references before asynchronous admission. Carry the acquired configuration and directories through runtime selection, CLI dispatch, model materialization, and authorization. Derive implicit runtime policy after admission while preserving explicit model, profile, runtime, and workspace requests. Remove the CLI path's ambient configuration fallback. Reuse prepared inline transport/header facts only with their captured config. Request projections retain canonical inline normalization while catalog, registry, and borrowed generation facts stay with their existing owner. Refs #130706. Production LOC: net +2; context consolidation absorbs the request-ownership capture except for the nested sampling-value copy.
|
🦞👀 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 maintainer review before merge. Reviewed September 5, 2026, 9:55 PM ET / September 6, 2026, 01:55 UTC. ClawSweeper reviewWhat this changesKeeps isolated completion configuration, directories, credentials, and transport settings consistent while preserving caller selections and cancellation through asynchronous preparation. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair absent from inspected main. No blocking correctness or security findings were identified. Priority: P1 Review scores
Verification
How this fits togetherIsolated completions provide fresh, tool-free model calls for generated labels, utility tasks, and plugins. Runtime admission supplies the configuration and credential context that the selected harness or CLI uses for inference. flowchart TD
A[Utility or plugin request] --> B[Capture selections and cancellation]
B --> C[Admit runtime generation]
C --> D[Resolve model and credentials]
D --> E[Revalidate caller authority]
E --> F[Harness or CLI inference]
F --> G[Return text and release lease]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +2, Tests +174, Docs +4. Total +180 across 7 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use one admitted generation for endpoint, credentials, runtime policy, and directories while retaining explicit caller choices and live cancellation checks. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the path: replace the configured runtime before admission completes, then observe completion preparation using the old caller context. This review did not execute a reproduction. Is this the best way to solve the issue? Yes. The patch repairs the existing admission owner and reuses the existing inline-model builder without introducing another configuration or credential path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b8731bc88a7c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Verified Validation passed: 274 focused tests, full build, full changed-file checks, independent P2 review, and 21 completed-build HTTP/harness controls. The proof tree is Commands recorded in the validation receipts: node --import ./scripts/tsx.mjs scripts/test-projects.mts src/agents/isolated-completion.test.ts src/agents/harness/isolated-completion.native-auth.test.ts src/agents/embedded-agent-runner/model.test.ts src/agents/embedded-agent-runner/model.inline-provider.test.ts src/agents/embedded-agent-runner/model.generation-scope.test.ts src/agents/prepared-model-runtime.test.ts src/agents/runtime-plan/materialize-model.test.ts
pnpm build
node scripts/check-changed.mjs -- docs/plugins/sdk-agent-harness.md src/agents/embedded-agent-runner/model.test.ts src/agents/embedded-agent-runner/model.ts src/agents/harness/isolated-completion.native-auth.test.ts src/agents/isolated-completion.test-support.ts src/agents/isolated-completion.test.ts src/agents/isolated-completion.tsExact-head CI passed. ClawSweeper has no before-merge findings. Native review artifacts are validated with zero findings. The repository-native prepare/merge workflow is next. |
|
Merged via squash.
|
* origin/main: fix(cli): keep note text with Windows and Unicode line endings (#139512) fix(agents): keep isolated completion context on its admitted generation (#139607) fix: avoid declaration builds during source-server updates (#139392) fix(models): keep discovered models after catalog refresh failures (#139357) fix(gateway): record a transcript notice when a run fails before replying (#139439) refactor(ios): reuse shared integer conversion (#139581) fix(sessions): prevent database lock failures during reclamation (#139469) perf(test): reuse transforms within owned scheduler slots (#139553) test(agents): share sparse transcript input fixtures (#139589) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479)
* commit '6c55a99226ed0611ca088004c81b00fb296f1f71': (182 commits) test(ui): scope dashboard settings setup to the top frame (openclaw#139618) refactor(skills): share pending proposal creation (openclaw#139617) fix(release): accept frozen targets before worker bundles (openclaw#136699) fix(gateway): preserve percent sequences in media filenames (openclaw#139508) fix: preserve current update availability alongside update history (openclaw#139501) feat(diagnostics): expose garbage collection duration metrics (openclaw#139592) fix(ui): keep Logbook timestamps clear of the activity stripe (openclaw#139539) fix(ui): keep Swarm outcomes visible after completion (openclaw#139490) test: check file accessibility without runtime-specific return values (openclaw#139590) refactor(sdk): keep helper types private (openclaw#139601) fix(cron): preserve current-session delivery intent (openclaw#139491) fix: prevent browser profile permission hangs in Doctor (openclaw#139612) fix(agents): repair storage-failure test fixture after failover owner move (openclaw#139531) fix(cli): keep note text with Windows and Unicode line endings (openclaw#139512) fix(agents): keep isolated completion context on its admitted generation (openclaw#139607) fix: avoid declaration builds during source-server updates (openclaw#139392) fix(models): keep discovered models after catalog refresh failures (openclaw#139357) fix(gateway): record a transcript notice when a run fails before replying (openclaw#139439) refactor(ios): reuse shared integer conversion (openclaw#139581) fix(sessions): prevent database lock failures during reclamation (openclaw#139469) ...
* commit 'refs/openclaw/tasks/pr-135167-main-latest': test(ui): scope dashboard settings setup to the top frame (#139618) refactor(skills): share pending proposal creation (#139617) fix(release): accept frozen targets before worker bundles (#136699) fix(gateway): preserve percent sequences in media filenames (#139508) fix: preserve current update availability alongside update history (#139501) feat(diagnostics): expose garbage collection duration metrics (#139592) fix(ui): keep Logbook timestamps clear of the activity stripe (#139539) fix(ui): keep Swarm outcomes visible after completion (#139490) test: check file accessibility without runtime-specific return values (#139590) refactor(sdk): keep helper types private (#139601) fix(cron): preserve current-session delivery intent (#139491) fix: prevent browser profile permission hangs in Doctor (#139612) fix(agents): repair storage-failure test fixture after failover owner move (#139531) fix(cli): keep note text with Windows and Unicode line endings (#139512) fix(agents): keep isolated completion context on its admitted generation (#139607) fix: avoid declaration builds during source-server updates (#139392) fix(models): keep discovered models after catalog refresh failures (#139357) fix(gateway): record a transcript notice when a run fails before replying (#139439)
…ion (openclaw#139607) Capture call-owned model/profile/sampling choices and validator/cancellation references before asynchronous admission. Carry the acquired configuration and directories through runtime selection, CLI dispatch, model materialization, and authorization. Derive implicit runtime policy after admission while preserving explicit model, profile, runtime, and workspace requests. Remove the CLI path's ambient configuration fallback. Reuse prepared inline transport/header facts only with their captured config. Request projections retain canonical inline normalization while catalog, registry, and borrowed generation facts stay with their existing owner. Refs openclaw#130706. Production LOC: net +2; context consolidation absorbs the request-ownership capture except for the nested sampling-value copy.
Related: #130706.
What Problem This Solves
After a configuration replacement, an isolated completion could acquire the new runtime generation but continue using the previous configuration and directories. A compiled reproduction sent the previous credential to the new provider endpoint. Utility completions, generated labels, and plugin callers share this owner.
An explicit request configuration could also inherit transport and headers from another configuration's prepared inline models. Mutable request objects could change a selected model, profile, or sampling parameters during preparation, or replace the validator and cancellation signal that belonged to the original call.
Why This Change Was Made
Capture call-owned choices and original validation/cancellation references before the first await. Carry one context from the acquired runtime snapshot through CLI dispatch, harness selection, model materialization, and authorization. Explicit models, profiles, runtime selections, and workspace overrides remain selected; implicit runtime policy and directories come from the admitted configuration. The CLI path no longer falls back to unrelated ambient configuration.
The model resolver reuses configured inline facts only with the configuration that prepared them. A projected configuration uses the existing inline builder while retaining catalog, registry, and generation facts. This preserves per-model API precedence, Google URL normalization, and borrowed generations while removing retired configured headers from projected requests.
This focused owner repair was found while extracting #130706. Production LOC is net +2 after consolidating the existing paths; the remaining growth captures nested sampling values while preserving live validators, signals, and owner-managed configuration. Tests/support are +174 and docs +4. No configuration, dependency, storage, protocol, or public SDK surface is added.
User Impact
New isolated completions use a coherent current endpoint, credential, runtime policy, and agent directory. Explicit choices remain fixed through asynchronous preparation. Borrowed completions remain on their retained generation; route projections receive their own transport and headers.
Evidence
Verified commit:
8a5bda6278bf01e54241ecfe5e065b5c98eea4c6, tree7711008c73c4eb174bfa2a7e1cf2294438f5e1b3. The touched files remain unchanged on the newer main baseline, and the candidate merges cleanly.The HTTP/harness reproductions use isolated synthetic credentials and local fixture endpoints through the actual built runtime. They are not authenticated external-provider or Codex-account tests. Explicit CLI binding replacement was also observed failing closed before dispatch; a synthetic third-party backend reached the unsupported isolated-capability boundary, so that control does not claim healthy CLI execution.