Restore agent chat composer#52
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)
📝 WalkthroughWalkthroughThis PR adds agent input messaging: client UI composes and sends text via a new ChangesAgent Input Messaging
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
🧹 Nitpick comments (1)
src/metadata-server.test.ts (1)
1348-1375: ⚡ Quick winAdd negative-path coverage for
/agents/input.Line 1348 covers success only. Please add explicit cases for missing
sessionId, empty/whitespacetext, and unsupported lifecycle hook (501) so this endpoint contract stays locked.🤖 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 `@src/metadata-server.test.ts` around lines 1348 - 1375, Add negative-path tests for the /agents/input handler in the metadata-server.test.ts suite: create cases that call POST /agents/input with (1) a missing sessionId (omit sessionId from body) and assert a non-2xx response and an error payload, (2) empty or whitespace-only text values (e.g., "" and " ") and assert validation errors, and (3) configure MetadataServer without a lifecycle.sendAgentInput (or with a lifecycle that returns a 501-like unsupported response) and assert the endpoint responds with 501 and an appropriate error body; use the same server start/stop pattern and the server.getAddress() base, and reference MetadataServer and lifecycle.sendAgentInput to locate where to change the test setup.
🤖 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/metadata-server.ts`:
- Around line 2656-2659: The request validation currently accepts strings
containing only whitespace because it checks body.text length without trimming;
update the check in the handler that examines body.text so it rejects inputs
where body.text.trim().length === 0 (call send(res, 400, { ok: false, error:
"text is required" }) and return) instead of only checking raw length, ensuring
whitespace-only submissions are treated as empty.
---
Nitpick comments:
In `@src/metadata-server.test.ts`:
- Around line 1348-1375: Add negative-path tests for the /agents/input handler
in the metadata-server.test.ts suite: create cases that call POST /agents/input
with (1) a missing sessionId (omit sessionId from body) and assert a non-2xx
response and an error payload, (2) empty or whitespace-only text values (e.g.,
"" and " ") and assert validation errors, and (3) configure MetadataServer
without a lifecycle.sendAgentInput (or with a lifecycle that returns a 501-like
unsupported response) and assert the endpoint responds with 501 and an
appropriate error body; use the same server start/stop pattern and the
server.getAddress() base, and reference MetadataServer and
lifecycle.sendAgentInput to locate where to change the test setup.
🪄 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: 1aed76ad-2425-48e9-81ad-6bdea18c023d
📒 Files selected for processing (8)
app/components/screens/AgentChatScreen.tsxapp/lib/api.test.tsapp/lib/api.tssrc/metadata-server.test.tssrc/metadata-server.tssrc/multiplexer/agent-io-methods.tssrc/multiplexer/dashboard-model.tssrc/multiplexer/session-runtime-core.ts
Summary
Verification
Summary by CodeRabbit
New Features
Backend/API
Tests