mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-08 10:59:18 +00:00
* fix(code-mode): use remaining exec budget before backgrounding Implicit bridged exec calls yielded after at most one second, forcing later model turns to collect short shell commands. An observed 36-turn run spent 11 turns polling commands that took 1-8 seconds, with each poll adding a 3-5 second model round trip. Use max(1, floor(remainingMs) - 250) for exec calls without yieldMs or background:true. Share the resume margin with the existing execution floor: a fresh 10-second call yields at 9750 ms, and 400 ms remaining yields at 150 ms. Explicit options and the resume-floor behavior stay unchanged. Document inline completion and remove the 1-second-yield example. Validation (wall times): - node scripts/run-vitest.mjs src/agents/code-mode.bridge.test.ts --maxWorkers=1 22 passed; 227.56 s. Before the production fix, the same updated tests failed only on 1000 vs 9750 and 100 vs 150 (20 passed, 2 failed; 196.08 s). - node scripts/run-vitest.mjs src/agents/code-mode.bridge.host-denial.test.ts --maxWorkers=1 35 passed; 129.84 s. - pnpm changed:lanes --json Selected core, coreTests, docs; 6.23 s. - node_modules/.bin/oxfmt --check src/agents/code-mode-bridge.ts src/agents/code-mode-execution.ts src/agents/code-mode-runtime.ts src/agents/code-mode.bridge.test.ts docs/tools/code-mode/tool-surface.md docs/gateway/background-process.md All six files passed; 1.66 s. - node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/code-mode-bridge.ts src/agents/code-mode-execution.ts src/agents/code-mode-runtime.ts src/agents/code-mode.bridge.test.ts Passed without diagnostics; 32.83 s. - node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo Passed; 22.13 s. - node scripts/run-tsgo-core-test-shards.mjs --changed-paths-json '["src/agents/code-mode.bridge.test.ts"]' agents-tools passed; 119.20 s including selection, 16.8 s compiler lane. - node scripts/check-docs-mdx.mjs docs/tools/code-mode/tool-surface.md docs/gateway/background-process.md Two files passed; 0.92 s. - git diff --check Passed; 1.40 s. - Codex autoreview: one round, scoped-clean through P2; 294.13 s. The initial baseline could not collect tests because installed TypeScript was older than the lockfile. pnpm install --frozen-lockfile restored the locked dependencies without tracked dependency changes. Agent-loop has no yield-value assertions, so it was not run. Full check-changed, broad guards, live services, and CI were intentionally not run for this scoped work. * fix(code-mode): keep settlement slack above the guest resume floor Reserving exactly the minimum 250 ms resume budget left no allowance for dispatch and result settlement. A command running to its yield could leave too little time to resume, park the snapshot, and require another wait. Keep the resume floor unchanged and derive a 500 ms exec yield margin as twice that floor. Implicit exec now yields at 9500 ms for a fresh 10-second budget and requests 1 ms when 400 ms remain. Explicit yieldMs and background options stay unchanged. This preserves the intended inline completion improvement for the observed run that spent 11 of 36 turns polling commands. Include the already-reviewed exec docs example using background:true and a bounded 30000 ms process poll, without rewriting that supplied edit. Validation (wall times): - node scripts/run-vitest.mjs src/agents/code-mode.bridge.test.ts --maxWorkers=1 22 passed; 58.77 s; peak RSS 7041138688 bytes. - node_modules/.bin/oxfmt --check src/agents/code-mode-bridge.ts src/agents/code-mode-runtime.ts src/agents/code-mode.bridge.test.ts docs/tools/exec.md docs/tools/code-mode/tool-surface.md All five files passed; 0.61 s. - node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/code-mode-bridge.ts src/agents/code-mode-runtime.ts src/agents/code-mode.bridge.test.ts Passed without diagnostics; 19.44 s. - node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo Passed; 13.39 s. - node scripts/check-docs-mdx.mjs docs/tools/exec.md docs/tools/code-mode/tool-surface.md Two files passed; 0.97 s. - git diff --check Passed; 0.50 s. Staged diff check also passed. - Codex autoreview through P2: two rounds. The first reported the old INDEX-only calculation, already fixed in the working tree (126.84 s). Staging the intended candidate resolved it; the second was scoped-clean with no actionable findings (111.73 s). No live timing remeasurement, broad suites, full check-changed, or CI run. |
||
|---|---|---|
| .. | ||
| configuration.md | ||
| executors.md | ||
| guest-api.md | ||
| internals.md | ||
| maintainers.md | ||
| output.md | ||
| quickstart.md | ||
| tool-surface.md | ||
| troubleshooting.md | ||