Skip to content

fix(tui): handle EventInputRequired via session.Respond in monitoring tab#377

Merged
pocky merged 1 commit into
mainfrom
tui-monitoring-fix
Jun 19, 2026
Merged

fix(tui): handle EventInputRequired via session.Respond in monitoring tab#377
pocky merged 1 commit into
mainfrom
tui-monitoring-fix

Conversation

@pocky

@pocky pocky commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix the TUI monitoring tab to handle EventInputRequired fired directly from the facade event stream, without relying on the legacy InputRequestedMsg path which required a TUIInputReader
  • Route user responses via session.Respond() when an active session is present, falling back to inputReader.Respond() for the older code path
  • Expose the prompt from EventInputRequired in the SSE API so clients receive it as part of the event payload
  • Switch conversation wiring tests from sonnet to haiku to reduce test cost

Changes

TUI

  • internal/interfaces/tui/tab_monitoring.go: Store the RunSession on ExecutionStartedMsg, extract beginInputRequest() helper shared by both InputRequestedMsg and facadeEventMsg/EventInputRequired paths; clear activeSession on run end; dispatch user responses via session.Respond() when available; guard empty-state view from hiding the input box mid-conversation
  • internal/interfaces/tui/tab_monitoring_test.go: Add test covering EventInputRequired received via facadeEventMsg — verifies input box appears and response is routed to the session; capture responses in mockRunSession

API

  • internal/interfaces/api/sse.go: Add Prompt field to sseEventData and populate it from EnrichedInputRequest payload when EventInputRequired is received
  • internal/interfaces/api/sse_test.go: Add test asserting eventDataFromEvent maps prompt correctly for EventInputRequired

Tests

  • internal/interfaces/cli/run_wiring_conversation_test.go: Replace sonnet with haiku in all inline workflow fixtures to reduce test execution cost

Test plan

  • Run unit tests: go test ./internal/interfaces/tui/... ./internal/interfaces/api/... ./internal/interfaces/cli/...
  • Launch a workflow that requires user input and verify the conversation input box appears and accepts a response via the TUI monitoring tab
  • Verify the SSE stream emits "prompt" in the input.required event payload for API consumers
  • Confirm no regression in the empty-state view when no execution is active

Generated with awf commit workflow

… tab

- `internal/interfaces/api/sse.go`: expose prompt field for EventInputRequired events
- `internal/interfaces/api/sse_test.go`: add test verifying prompt is included in SSE output
- `internal/interfaces/cli/run_wiring_conversation_test.go`: switch test fixtures from sonnet to haiku model
- `internal/interfaces/tui/tab_monitoring.go`: route input responses through activeSession, extract beginInputRequest helper, fix empty-state guard
- `internal/interfaces/tui/tab_monitoring_test.go`: add test for facade-driven input request flow with session.Respond
@pocky pocky marked this pull request as ready for review June 19, 2026 22:17
@pocky pocky merged commit df2454b into main Jun 19, 2026
5 checks passed
@pocky pocky deleted the tui-monitoring-fix branch June 19, 2026 22:17
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