Skip to content

refactor(cli): extract shell-run hydration controller - #1440

Merged
Astro-Han merged 1 commit into
apache:mainfrom
w3lld1:refactor/1412-shell-run-hydration
Jul 25, 2026
Merged

Astro-Han merged 1 commit into
apache:mainfrom
w3lld1:refactor/1412-shell-run-hydration

Conversation

@w3lld1

@w3lld1 w3lld1 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • move shell-run hydration, owner mapping, buffering, and retry state into a dedicated controller
  • leave pi-tui-runner.ts responsible only for driver, transcript, ticker, and render wiring
  • preserve session reset, teardown, catch-up replay, live update, and overflow rehydration behavior

Verification

  • npm --workspace maka-agent run typecheck
  • node --test packages/cli/dist/__tests__/pi-tui-runner.test.js (197 tests passed)
  • npx biome format packages/cli/src/pi-tui-runner.ts packages/cli/src/shell-run-hydration.ts
  • npx biome lint packages/cli/src/pi-tui-runner.ts packages/cli/src/shell-run-hydration.ts
  • git diff --check

I also ran npm --workspace maka-agent test: 643 tests passed, while four existing runtime-bootstrap sandbox tests could not run because this host does not provide the required command sandbox. The complete suite is left to CI.

Fixes #1412

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings. The controller now owns hydration state, buffering, retries, and subscription teardown. pi-tui-runner keeps only the transcript, ticker, and render wiring.

The runner tests cover the concurrency and lifecycle behavior affected by this extraction. Approving.

GitHub has not reported remote checks for this branch, so CI should still run before merge.

@Astro-Han
Astro-Han merged commit 6cb84b8 into apache:main Jul 25, 2026
3 checks passed
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.

refactor(cli): extract the shell-run hydration state machine from pi-tui-runner.ts

2 participants