Skip to content

feat: add chat wait predicates and tui cockpit#57

Merged
zeke-ricon merged 6 commits into
mainfrom
zeke/chat-tui-wait-predicates
Jun 25, 2026
Merged

feat: add chat wait predicates and tui cockpit#57
zeke-ricon merged 6 commits into
mainfrom
zeke/chat-tui-wait-predicates

Conversation

@zeke-ricon

Copy link
Copy Markdown
Contributor

Summary

  • add chat wait sender/mention predicates plus polling/loop controls
  • add chat tui as a zellij/gum/fzf cockpit
  • implement TUI panes as addressable mise subtasks: tui:rooms, tui:view, tui:compose
  • update README generation and BATS coverage

Validation

  • mise run test
  • mise run readme --check
  • git diff --check
  • zellij setup --dump-layout lib/tui/layout.kdl >/dev/null
  • codebase lint "$PWD"
  • targeted bats test/tasks.bats --filter 'task (wait|tui)'

Comment thread .mise/tasks/wait Outdated
finish_message()
print count + 0
}
' <<EOF_CONTENT

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

semantic guard? <<'AWK'?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 17fa99a: moved the AWK program to a quoted AWK heredoc, renamed the input guards (CHAT_CONTENT, CHAT_HEADERS), and swept the remaining generic EOF heredocs in chat to semantic guards.

@ikma-ricon ikma-ricon 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.

Adversarial pass focused on task/API/env/shell-safety. I found one correctness issue I would block on:

  • chat wait --mention/--mentioned currently treats mentions as plain substrings (index(body, "@" mention_filter)). That means chat wait --as ann --mentioned wakes on @anna / @annabelle, then advances Ann’s cursor as if she was actually mentioned. This is a task/API boundary bug: the false-positive wake can mark unrelated messages read and it is exactly the kind of mention predicate edge case that will be painful in agent channels with prefix-like identities.

I opened fix-it PR #58 against this branch with a token-boundary matcher plus regressions for @ann vs @anna and punctuation-delimited @ann,. Please take that or an equivalent fix before merging.

Other areas I checked: cursor advancement around sender filters and pure-own messages, batch/loop shape, #USAGE default coverage for the new wait/TUI tasks, stale usage_* clearing through chat_tui_clean, zellij env propagation for CHAT_TUI_*/CHAT_*, macOS Bash-visible constructs, traps/tempfiles, and the nested mise run -C calls from panes. I did not find another blocker in those paths.

Validation I ran locally on the PR branch / fix-it branch:

  • mise run test
  • codebase lint "$PWD"
  • git diff --check
  • bats test/tasks.bats --filter 'task wait' (on the fix-it)\n

@baby-joel baby-joel 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.

Adversarial pass focused on TUI runtime/UX/test/readme. I found two issues I would require fixing before merge, and opened the fix-it PR here: #59

Required:

  • Generated README command discovery stops at top-level/default tasks, so chat tui:rooms, chat tui:view, and chat tui:compose are advertised as independently runnable but are not documented in the generated Commands section. This also undercounts the command surface and would have missed existing nested cursor tasks.
  • The TUI pane clear fallbacks are not actually quiet when TERM is missing/unsupported: clear emits diagnostics like unknown terminal type / TERM environment variable not set, which pollutes real panes and the independent pane-task contract.

Validation I ran:

  • mise run test on PR #57: passed (199 tests)
  • pseudo-tty zellij smoke with script + timeout: layout/panes launched, but in a fresh zellij environment the first-run setup wizard also appears; not blocking this PR by itself, but it is a runtime assumption worth keeping in mind for agents on fresh boxes.
  • mise run test on fix-it PR #59: passed (201 tests)

I did not find a separate blocker in the room switching/state-file loop, live-view refresh hash, compose send loop, or wait predicate behavior beyond the README/testability and terminal-noise gaps above.

@zeke-ricon
zeke-ricon requested a review from baby-joel June 25, 2026 18:38

@baby-joel baby-joel 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.

Re-reviewed the updated head (17fa99a) against both requested-change areas and Or's heredoc note.

Verified:

  • chat wait --mention/--mentioned now uses a token-boundary matcher instead of substring matching. @ann no longer matches @anna, punctuation-delimited @ann,/@ann: still wakes, and a false-positive mention candidate does not advance Ann's cursor.
  • README task discovery now descends into nested/default task directories; the generated README includes chat cursor:clear, chat cursor:undo, chat tui, and the pane tasks chat tui:compose, chat tui:rooms, chat tui:view.
  • TUI pane clear/tput fallbacks suppress terminal diagnostics when TERM is missing/unsupported.
  • The touched heredocs now use semantic guards, including the quoted AWK program guard in .mise/tasks/wait.

Validation I ran locally:

  • bats test/tasks.bats --filter 'task wait: --mentioned|task tui:|task tui:'
  • mise run readme --check
  • manual --mention ann check confirming @anna times out without advancing the cursor, then @ann: wakes.

No remaining blocker from my pass.

@zeke-ricon
zeke-ricon merged commit 95886c6 into main Jun 25, 2026
2 checks passed
@zeke-ricon
zeke-ricon deleted the zeke/chat-tui-wait-predicates branch June 25, 2026 18:45
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.

4 participants