Harden chat protocol parsing and submit flow - #54
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a composer protocol and integrates it into AgentChatScreen and tmux send flow; enhances parseAgentOutput to better classify Codex/Claude UI and preserve trailing prompts; context bridge now uses parser for live snapshots; normalizes image attachment URLs and adds tests. ChangesMessage Composition & Sending
Agent Output Parsing & Context Extraction
Message Display Improvements
Sequence Diagram(s)sequenceDiagram
participant User
participant AgentChatScreen
participant ComposerProtocol
participant SessionRuntime
participant TmuxTransport
User->>AgentChatScreen: type text / press Enter
AgentChatScreen->>ComposerProtocol: normalizeComposerDraft(draft)
ComposerProtocol-->>AgentChatScreen: normalizedDraft or null
AgentChatScreen->>ComposerProtocol: getComposerSendText(state)
ComposerProtocol-->>AgentChatScreen: composerSendText or null
AgentChatScreen->>ComposerProtocol: shouldSubmitComposerKey(event)
ComposerProtocol-->>AgentChatScreen: true/false
AgentChatScreen->>SessionRuntime: handleSendMessage(composerSendText)
SessionRuntime->>TmuxTransport: sendAgentInput(normalized prompt)
TmuxTransport-->>SessionRuntime: waitForTmuxPromptSubmit result
SessionRuntime-->>AgentChatScreen: acceptance result
sequenceDiagram
participant TmuxPane
participant ContextBridge
participant OutputParser
participant ContextWatcher
TmuxPane->>ContextBridge: capturePaneSnapshot(normalized text)
ContextBridge->>OutputParser: parseAgentOutput(pane text)
OutputParser-->>ContextBridge: parsed blocks (meta/prompt/status/response)
ContextBridge->>OutputParser: select last response block
OutputParser-->>ContextBridge: final response text
ContextBridge->>ContextWatcher: snapshotTurn = response text
ContextWatcher-->>ContextBridge: snapshot recorded
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/agent-output-parser.ts`:
- Around line 82-86: The current bullet-line regexes treat any bullet containing
"for <n>s", an ellipsis, or a trailing parenthetical as a status, which swallows
normal assistant replies; narrow these patterns in agent-output-parser by
changing the checks that use trimmed (the /^•\s?\S.*\bfor \d+s\b/ and
/^[*✻✽✶]\s+\S.*(?:\bfor \d+s\b|\.\.\.|…|\(.+\))$/ tests) to only match
well-known short status phrases — e.g., require the bullet to start with a
capitalized status keyword
(Starting|Started|Stopped|Running|Restarting|Added|Removed|Updated) or to be a
very short token (limit to 1–3 words) when paired with a
timing/ellipsis/parenthetical, and restrict parenthetical matches to explicit
timing formats like \(\d+(?:ms|s)\); update those regexes accordingly so
ordinary sentences like "I'll wait for 5s..." or "Added tests (2 files)" no
longer qualify as status lines.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 99f57741-8317-4842-8224-2b062bf3c106
📒 Files selected for processing (11)
app/components/MessageBlock.test.tsapp/components/MessageBlock.tsxapp/components/screens/AgentChatScreen.tsxapp/lib/composer-protocol.test.tsapp/lib/composer-protocol.tssrc/agent-output-parser.test.tssrc/agent-output-parser.tssrc/context/context-bridge.test.tssrc/context/context-bridge.tssrc/multiplexer/session-runtime-core.test.tssrc/multiplexer/session-runtime-core.ts
Summary
Verification
Summary by CodeRabbit
Bug Fixes
Improvements
Tests