Skip to content

F: share one read-only container runner between Ask and planning (#117, part 1) - #118

Merged
mchwang merged 2 commits into
mainfrom
feat/117-shared-runner
Oct 4, 2026
Merged

mchwang merged 2 commits into
mainfrom
feat/117-shared-runner

Conversation

@mchwang

@mchwang mchwang commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Part 1 of #117. Ask and the planning provider ran the same lane D lifecycle from two near copies. This change gives them one runner.

Change

  • runReadOnlyAgent(feature, run, deps, signal, image, retained) in runner/question-container.ts runs one read-only agent. It refuses a missing credential, releases leftovers, builds the image, stages the input, checks the size, then clones, allocates, captures and starts the agent. It settles before release, and cleans up on every path.
  • A ReadOnlyFeature supplies what differs between features: phase, root prefix and removal, storage limits, credential rule, size check, setup timeout message, output check, and cleanup error.
  • ASK_FEATURE keeps Ask's wording and its cleanup error exactly. askInContainer is now a wrapper.
  • PLANNING_FEATURE keeps planning's wording. A failed request keeps its own error first, followed by the cleanup failure (from E4: planning acceptance fixtures and recorded Claude output #45).

Behavior

There is no intended change for Ask. Its suites pass unchanged: question-agent, question-leftovers and questions, 93 tests. The planning suites also pass unchanged: 78 tests.

Validation

  • npm run typecheck: passed.
  • CI's npm test command: 1365 passed in one run. The 26 failures were 25 timeouts and one timing assertion, at a machine load average of about 115. All 8 affected files then passed when run alone: 321 tests. On the base commit under the same load, the same Ask timeout also failed.
  • git diff --check: passed.

Independent review

A fresh subagent compared the old and new Ask and planning paths line by line. It found no observable change to Ask, and planning matches the old provider. It also confirmed that module initialization is safe and there is no import cycle.

Its test gaps are fixed in 870eed3:

  • planning tests for root removal, an oversized repository, the budget timeout, and a single image build;
  • Ask's exact timeout and cleanup messages are pinned;
  • a test that Ask reports only its own cleanup error.

Also fixed:

  • a doc comment orphaned by the move;
  • planning's guard error now names the root;
  • one shared exceedsStorage size check replaces two copies.

Tests at that head: 69 in the Ask and planning-provider suites, plus 107 in the other planning and Ask suites.

Part 2 (worker, timeout, inputs, wiring) follows in a separate PR.

🤖 Generated with Claude Code

mchwang and others added 2 commits October 3, 2026 18:09
… part 1)

askInContainer and createPlanningProvider were near copies. Extract
runReadOnlyAgent in runner/question-container.ts; each feature passes a
ReadOnlyFeature with its phase, host root and removal, storage limits,
credential rule, size check, output and cleanup wording. Ask's messages and
cleanup error are unchanged (ASK_FEATURE); planning keeps its own
(PLANNING_FEATURE). removePlanningRoot now names the root in its own error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Test planning's root-removal failure end to end, its too-large refusal,
  budget timeout and single image build.
- Pin Ask's exact timeout and cleanup messages, and that a failed question's
  cleanup failure reports only Ask's cleanup error.
- Share the storage-size comparison (exceedsStorage); name the root in
  planning's guard error; restore askInContainer's doc comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mchwang
mchwang merged commit 1b826bb into main Oct 4, 2026
2 checks passed
@mchwang
mchwang deleted the feat/117-shared-runner branch October 4, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant