Skip to content

feat(agent): port rootly-ai-tui polish (welcome, focus cursor, continuation, wide tables, exit codes) - #77

Open
kwent wants to merge 14 commits into
devin/1793454306-agent-mcpfrom
devin/1793476918-agent-polish
Open

kwent wants to merge 14 commits into
devin/1793454306-agent-mcpfrom
devin/1793476918-agent-polish

Conversation

@kwent

@kwent kwent commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Why: rootly-ai-tui is being abandoned in favour of the hidden rootly agent / rootly chat. This ports the small UX items from the reverse audit (rows 17/18/22/24/27/37/40/47/52/62/63/82/87/94). Stacked on #75. CLI only.

What

  • Welcome block: Welcome back, <first name> · <team>, the cwd (~-abbreviated), the API host, and Ask me about incidents, alerts and on-call only when it fits the width. The pulse logo is unchanged and stays centred beside the rows.
  • Focus: View().ReportFocus = true. tea.BlurMsg draws a hollow ▢ cursor, tea.FocusMsg restores the solid one. Bubble Tea parses the focus sequences, so they never reach the composer.
  • Composer: a trailing \ + Enter becomes a newline (\\ still submits). When the composer scrolls, ↑ N more lines shows above it.
  • Markdown: bulletizeWideTables runs in prepareAssistantMarkdown. A table wider than the render width becomes - **cell1** · Header2: cell2 · …. Tables inside fences and tables that fit are left as they are.
  • Activity: failed lines get a red ✗. No-color output stays plain.
  • Resume: a 404 on the session's history prints Session not found — starting a new chat and calls startNewSession().
  • MCP startup: once no server is still connecting, one line is printed per errored, session-enabled server: MCP 'x' unreachable: <reason> — open /mcp.
  • client_tools_accepted > 0 prints N local tools available once.
  • Exit codes: NotAuthenticatedError (no credentials, or a 401 from preflight or the stream) becomes exit code 2 in print mode via PrintExitError/ExitCodeError. Other errors stay at 1. The codes are documented in rootly agent --help.
  • CI: Verify binary now also runs ./bin/rootly --version.
  • Row 37 (exit/quit) was already in place via isExitAlias, with tests.

Not done: the welcome block has no role row. rootly-go's CurrentUser only has the role id, /v1/users/me?include=role returns no included role, and /v1/roles/{id} 404s for a user's built-in role. Showing a role needs an API change, which is out of scope here (CLI only).

Risk: low. The changes are display-only, plus the print-mode exit code for unauthenticated runs.
Rollback: revert this PR.

Link to Devin session: https://rootly.devinenterprise.com/sessions/5e2e52b477b74d98b9ed9500fe7b4860
Open in Devin Desktop: https://rootly.devinenterprise.com/desktop/session/5e2e52b477b74d98b9ed9500fe7b4860?variant=devin
Requested by: @kwent


Devin Review

…uation, wide tables, exit codes)

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot 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.

✅ Devin resolved all 8 findings on 4124472

Fixed by Devin (8)

  • Loading status persists after history finishes
  • Late history corrupts an active chat
  • Longer fence closers hide subsequent tables
  • Escaped backslashes merge table columns
  • Header-only wide tables disappear
  • Escaped pipes corrupt table values
  • Tables inside long fences get rewritten
  • Three trailing backslashes submit unexpectedly

View all findings in Devin Review

Devin Review

devin-ai-integration Bot and others added 2 commits October 31, 2026 20:13
…tact

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge as part of the supplied stack, with PR #79 required for the queue-related clearances.

Summary

This PR polishes the agent’s welcome screen, composer, tables, activity messages, MCP notices, and print-mode exit codes.

  • The chat welcome area greets users by first name and shows their working folder.
  • The composer shows its focus and makes long prompts easier to enter.
  • Wide assistant tables turn into readable row bullets.
  • Resumed chats recover from missing history and wait before sending new prompts.
  • The chat reports MCP startup problems and makes failed activity easier to spot.
  • Print mode exits with code 2 when the user is not authenticated.
  • The binary check verifies both supported version flags.

Reviews (5) · Last reviewed commit: "refactor(agent): move history handling o..." · Reviewed by Greptile

greptile-apps[bot]

This comment was marked as resolved.

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
devin-ai-integration Bot and others added 5 commits November 1, 2026 00:32
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
… on one snapshot

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@greptileai review

greptile-apps[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 3 commits November 2, 2026 14:38
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@greptileai review

Comment thread internal/agent/tui.go Resolved
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@greptileai review

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@greptileai review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Completed real-terminal/tmux E2E on final head 4124472c01e7360247614870f534846276443be2, against local Rails 7d689c64c3b, the real LLM, and the official filesystem MCP server. The main flow used --api-host localhost:3000, both required FileData flags enabled, and isolated HOME.

Requested runtime checks passed:

  • 17/18/94: Welcome shows John1, cwd, localhost:3000, and the pulse/header. Capability text appears at 60 columns and disappears at 54. No role row, as documented in this PR.
  • 22 / 24 / 27: Focused solid cursor becomes hollow on blur, preserving focus-check with no focus bytes; one trailing backslash inserts a newline, two submit; composer overflow shows ↑ 7 more lines.
  • 40: Fitting Markdown table stays a table; at narrow width the overwide table becomes bullets. Fenced pipe-table stays literal.
  • 47: Missing-file read produces the CLI's red ✗ local · fs · read_text_file failed: ENOENT…. The separate Rails task-status checkmark remains unchanged.
  • 52 + new queued-history behavior: Missing-session resume recovers and a fresh prompt answers. For deterministic pre-settlement timing, a temporary transparent :3001 → real Rails :3000 forwarder held the real history response for eight seconds. Submitting while pending displayed Loading session history…; the real 404 then printed Session not found — starting a new chat and automatically sent the queued prompt. Exactly one user turn and one QUEUED_READY_4124472 answer; no second Enter and no stale loading status.
  • 62 / 63: Broken-MCP startup notice and 14 local tools available each occur exactly once in the captured primary-turn transcript.
  • 37 / 82 / 87: Bare exit and quit return to the shell; invalid-key print mode exits 2, unreachable host exits 1, help documents 0/1/2; both version commands identify 4124472.

Coverage boundary: Queued skill prompts and queue cancellation via /new, session switching, or Ctrl+C were not separately exercised. PR #79 is outside this run. Initial expired-key access was repaired before authenticated testing. No CLI/Rails contract mismatch was observed.

One recording, motion-trimmed to 40.8 seconds, with an animated WebP derived from that same recording:

PR77 final-head terminal E2E

Welcome block Resume 404 → fresh chat
Welcome Resume recovery
Blurred — hollow cursor Focused — solid cursor
Blurred Focused
\ + Enter continuation ↑ N more lines overflow
Continuation Overflow
Pending real history — prompt queued Real 404 — automatic single answer
Loading history after submitting the queued prompt Queued prompt automatically sent once
Red local-tool failure Print exit codes, help and version
CLI red failure and unchanged Rails status Print-mode codes and final build metadata
Regression — fitting and fenced table Regression — narrow bullets, fence unchanged
Fitting table and literal fenced pipe table Overwide table bulletized in narrow terminal
Regression — capability fits at 60 columns Regression — capability omitted at 54
Welcome at 60 columns Welcome at 54 columns

No implementation changes or GitHub posting. Real ~/.rootly-cli/mcp.json was untouched; SHA-256 remains 5967c9e020c681c9717357ef8b42af71ea96ab6aeac8e5ba215d949e8f9976fc. The temporary delay forwarder has been stopped.

Devin session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant