Skip to content

refactor(interaction): move request lifecycle out of TUI - #694

Merged
san-ci[bot] merged 3 commits into
genai-io:mainfrom
yanmxa:refactor/conversation-lifecycle
Oct 30, 2026
Merged

san-ci[bot] merged 3 commits into
genai-io:mainfrom
yanmxa:refactor/conversation-lifecycle

Conversation

@yanmxa

@yanmxa yanmxa commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Purpose

Extract approval, question and secret-input request lifecycle from the TUI into internal/interaction, allowing a future ACP adapter to reuse it.

Responsibilities

Package Owns
interaction (new) Request queue, context/owner checks and cancellation replies
app (existing) Active-request display, user choices, authorization and audit ordering
agent.Runtime (unchanged) Agent execution

The new package is named interaction, not conversation: it manages requests awaiting an external response, not whole conversations.

API

  • Request.Valid(owner) / Cancel(): validate lifetime and ownership; send a nonblocking cancellation reply.
  • Queue.Enqueue(request, owner) / Pop(): validate and queue requests; retrieve them in FIFO order.
  • Queue.Prune(owner) / Cancel(): remove invalid requests or cancel all queued requests.

The queue is single-owner and starts no goroutines. The TUI retains and validates the active request. Foreground cancellation does not cancel independent background requests with live contexts.

Scope and validation

  • No ACP endpoint, SDK update, prompt/turn lifecycle extraction or persistence changes.
  • Rebased onto upstream/main at 47479b97 (feat(agent): simplify delegation and continue sessions through SendMessage #692).
  • After rename: go test ./..., interaction/TUI race tests, layercheck and make lint passed.
  • Consistency review found no blockers; design and implementation plan now distinguish completed interaction extraction from pending shared execution.
  • Unrelated local configuration changes are excluded.

@san-ci san-ci Bot added the dco:yes label Oct 29, 2026
@san-ci

san-ci Bot commented Oct 29, 2026

Copy link
Copy Markdown

[REVIEW NOTIFIER] This PR requires a review from @zhujian7.

Once this PR has been reviewed and has the lgtm label, it will be automatically squash-merged.

Suggested reviewer

Based on OWNERS, @zhujian7 is suggested to review this PR.

How to get your PR reviewed:

  • Address reviewer feedback and push changes
  • Reviewer adds lgtm label when satisfied
  • An approving review + lgtm will trigger auto-merge

@san-ci san-ci Bot added approved needs-rebase Conflicts with main; rebase required labels Oct 29, 2026
@san-ci

san-ci Bot commented Oct 29, 2026

Copy link
Copy Markdown

[REVIEW NOTIFIER] This PR requires a review from @zhujian7.

Once this PR has been reviewed and has the lgtm label, it will be automatically squash-merged.

Suggested reviewer

Based on OWNERS, @zhujian7 is suggested to review this PR.

How to get your PR reviewed:

  • Address reviewer feedback and push changes
  • Reviewer adds lgtm label when satisfied
  • An approving review + lgtm will trigger auto-merge

@yanmxa yanmxa changed the title refactor(conversation): extract interaction lifecycle refactor(conversation): move interaction queue out of TUI Oct 29, 2026
@yanmxa
yanmxa force-pushed the refactor/conversation-lifecycle branch from cdf0b11 to 5eee6c1 Compare October 29, 2026 13:56
@san-ci san-ci Bot added needs-rebase Conflicts with main; rebase required and removed needs-rebase Conflicts with main; rebase required labels Oct 29, 2026
@yanmxa yanmxa changed the title refactor(conversation): move interaction queue out of TUI refactor(interaction): move request lifecycle out of TUI Oct 29, 2026
@yanmxa

yanmxa commented Oct 30, 2026 •

Copy link
Copy Markdown
Member Author

Regression validation completed on the renamed interaction package:

  • Real TUI smoke test in an isolated tmux session: first-run theme selection, startup, text submission without a provider (expected error), resize, /help, and /exit (exit code 0).
  • Race-enabled tests passed for interaction, app/conv, app, and permission/agent integration suites.
  • Live model/tool approval was not exercised in tmux; approval, cancellation and background isolation were covered by automated regressions.
  • Remote test, Windows test and vulnerability checks passed; Review Gate remains pending.

@zhujian7

Copy link
Copy Markdown
Contributor

/lgtm

@san-ci san-ci Bot added the lgtm label Oct 30, 2026
Signed-off-by: Meng Yan <yanmxa@gmail.com>
Signed-off-by: Meng Yan <yanmxa@gmail.com>
Signed-off-by: Meng Yan <yanmxa@gmail.com>
@san-ci
san-ci Bot force-pushed the refactor/conversation-lifecycle branch from 1c06482 to 458728a Compare October 30, 2026 02:01
@san-ci san-ci Bot removed the needs-rebase Conflicts with main; rebase required label Oct 30, 2026
@san-ci
san-ci Bot merged commit a1717f6 into genai-io:main Oct 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants