Skip to content

feat: add AskUserQuestion runtime and TUI - #908

Merged
Astro-Han merged 6 commits into
mainfrom
feat/825-ask-user-question-tui
Jul 13, 2026
Merged

feat: add AskUserQuestion runtime and TUI#908
Astro-Han merged 6 commits into
mainfrom
feat/825-ask-user-question-tui

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

  • Add one shared turn-scoped await primitive and the AskUserQuestion runtime request/response contract.
  • Register the AI SDK tool only for the root TUI surface and render a FIFO terminal interaction with bounded options, Other input, explicit unanswered answers, and Stop support.
  • Preserve answers only as the normal JSON tool result so the same model turn can continue without fabricating a user turn.

Why

Refs #825. Agents need a bounded way to ask the user for missing decisions and then continue the same turn. This extends the existing permission/runtime/TUI seams while keeping their separate policy and lifecycle responsibilities.

Scope

Desktop registration and UI remain PR3. This PR deliberately excludes maka run, headless/Harbor, Pi transport, child agents, and the other out-of-scope items recorded in #825.

Verification

  • npm --workspace @maka/core test — 873 passed, 0 failed.
  • npm --workspace @maka/runtime test — 1,470 passed, 0 failed, 7 skipped.
  • npm --workspace maka-agent test — 317 passed, 0 failed.
  • npm run typecheck — all workspaces passed.
  • git diff --check origin/main...HEAD — passed.
  • Interactive behavior is covered with the real pi-tui FakeTerminal: bottom-overlay rendering and placement, FIFO sequencing, keyboard selection, Other editing/submission, Esc unanswered, Stop, abort, and late responses. A static screenshot is not useful evidence for this stateful terminal interaction.

Impact

The root interactive TUI gains AskUserQuestion. Existing permission behavior remains unchanged, including its 300-second timeout; user questions have no fixed timeout and remain interruptible by Stop/abort/teardown. No migration or release-note action is required.

Reviewer notes

The response command is intentionally ephemeral. Only the resulting JSON tool result is durable. Reviewer completed two full-diff passes, including after rebasing onto current main, with no P0–P3 findings and a Go conclusion.

Ready for review

  • Verification is complete and the results above are current
  • Impact, compatibility, migration, documentation, and release-note needs are addressed
  • User-visible UI/UX changes include visual evidence, or Verification explains why it is not applicable

@Astro-Han
Astro-Han merged commit 9d4656d into main Jul 13, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the feat/825-ask-user-question-tui branch July 13, 2026 18:37
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