Fix GUI chat parser and lifecycle state - #362
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 Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe pull request updates agent UI rendering and error handling, session loop metadata, transcript parsing and prompt normalization, host-agent retries, private-network CORS responses, and project-scoped host command routing. ChangesAgent UI and session state
Transcript parsing and prompt normalization
Transport and project routing
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Independent review finding resolved: app/lib/parsed-transcript.ts only parsed the first flattened attachment item. Fixed in ea9ab8c by scanning every item after the Attached image files header and adding a two-image regression test. |
|
Independent review finding resolved: active loop goals could not be updated from the GUI. Fixed in ea9ab8c by allowing Save when the active goal differs from the current server goal. |
|
Independent review finding resolved: loop goal input could stay stale after session metadata refresh. Fixed in ea9ab8c by syncing refreshed server goal state unless the user has diverged with an in-progress edit. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
app/components/agent-actions.tsx (1)
128-128: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRedundant re-classification on already-filtered state; consider a shared hook.
errorcan only ever hold a non-transient message (the catch at Lines 113-115 already discards transient errors before callingsetError). Re-runningisTransientRequestErroron the stringified message here is dead weight —isTransientRequestErrorclassifies byerror.name === "AbortError"and message regex on the original error object; once stringified, the name check is lost and only the (already-passed) message regex re-runs, so the result can never differ fromtrue.The same set-then-recheck pattern is duplicated nearly verbatim in
teammate-panel.tsx,worktree-management-panel.tsx,agent-create-panel.tsx, andagent-management-panel.tsx. Extracting a small hook (e.g.useActionError()returning{ error, visibleError, setError, catchError }) would remove the redundant computation and centralize the classification logic so future changes to transient-error rules don't need updating in five places.♻️ Sketch of a shared hook
// app/lib/use-action-error.ts import { useCallback, useState } from "react"; import { isTransientRequestError } from "`@/lib/request-errors`"; export function useActionError() { const [error, setErrorState] = useState<string | null>(null); const setError = useCallback((e: unknown | null) => { if (e === null) return setErrorState(null); if (!isTransientRequestError(e)) { setErrorState(e instanceof Error ? e.message : String(e)); } }, []); return { error, setError }; }🤖 Prompt for 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. In `@app/components/agent-actions.tsx` at line 128, Extract the duplicated transient-error classification into a shared useActionError hook and update agent-actions.tsx plus the corresponding teammate, worktree, agent-create, and agent-management panels to use it. Have the hook expose the stored error and setter/catch behavior, classify the original unknown error before stringifying it, and remove each component’s redundant visibleError re-check while preserving null handling and existing display behavior.
🤖 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 `@app/lib/parsed-transcript.ts`:
- Around line 60-95: Update partsFromFlattenedAttachmentText to isolate the
section beginning at the “Attached image files:” header, normalize whitespace
only within that attachment segment, and parse the header plus subsequent
attachment entries without requiring the header for each match. Preserve text
before and after the attachment block, including paragraph breaks, when
constructing HistoryPart[].
In `@src/metadata-server.ts`:
- Around line 2191-2195: Restrict the Access-Control-Allow-Private-Network
response in the metadata server CORS handling to trusted origins or
authenticated requests, rather than enabling it alongside the wildcard origin;
reuse the existing trusted-origin policy if available. Preserve normal CORS
behavior for untrusted requests without returning the PNA header, and add a
regression test covering an untrusted origin.
---
Nitpick comments:
In `@app/components/agent-actions.tsx`:
- Line 128: Extract the duplicated transient-error classification into a shared
useActionError hook and update agent-actions.tsx plus the corresponding
teammate, worktree, agent-create, and agent-management panels to use it. Have
the hook expose the stored error and setter/catch behavior, classify the
original unknown error before stringifying it, and remove each component’s
redundant visibleError re-check while preserving null handling and existing
display behavior.
🪄 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
Run ID: b46429cd-c79c-4f44-a6a6-65ed25611706
📒 Files selected for processing (26)
app/components/MessageBlock.tsxapp/components/agent-actions.tsxapp/components/agent-create-panel.tsxapp/components/agent-management-panel.tsxapp/components/screens/AgentChatScreen.tsxapp/components/service-actions.tsxapp/components/teammate-panel.tsxapp/components/workflow-actions.tsxapp/components/worktree-management-panel.tsxapp/lib/desktop-state.tsapp/lib/parsed-transcript.test.tsapp/lib/parsed-transcript.tsscripts/installed-aimux-shim.shsrc/agent-output-parser-audit.test.tssrc/agent-output-parser.test.tssrc/agent-output-parser.tssrc/agent-prompt-delivery.test.tssrc/agent-prompt-delivery.tssrc/daemon.test.tssrc/daemon.tssrc/dashboard/index.tssrc/installed-shim.test.tssrc/main.tssrc/metadata-server.test.tssrc/metadata-server.tssrc/multiplexer/dashboard-model.ts
Summary
Smoke testing
Verification
Summary by CodeRabbit
New Features
--projectpath support for agent output capture and streaming.Bug Fixes