fix(studio): Fix simultaneous user requests not being shown on the Code Agent#473
Conversation
… the same time Signed-off-by: Henrique Tolentino <htolentino@nvidia.com>
896e365 to
eab8e5f
Compare
📝 WalkthroughWalkthroughRefactors ChangesClaude Code chat runtime refactor
Possibly related PRs
Suggested reviewers
🚥 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 |
|
@CodeRabbit review now, please! |
|
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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
`@web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useClaudeCodeChatRuntime.ts`:
- Around line 591-596: Guard the stale in-flight resolution side effects in
useClaudeCodeChatRuntime so appendUserMessage and the clear_input dispatch only
run for the currently active session/request. The current requestId check
protects the reducer action, but not the appendUserMessage calls or later
resolution paths, so add a session/request token check around the relevant
completion handlers and skip all post-resolution mutations when handleReset or
loadSession has replaced the thread. Update the logic near appendUserMessage,
dispatchBlocking, and the related resolution blocks later in the file to compare
against the current active state before mutating.
- Around line 654-656: The answer handling in useClaudeCodeChatRuntime should
not fall back to choice.label for custom AskUserQuestion inputs. Update the
submission flow around activeDecision.questions so that choices with input
accept only submission?.text?.trim(), while non-input choices can still use
choice.label.trim(); keep the early return when no text was entered.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 98a0a1c0-e4da-4205-9046-a216f36adb51
📒 Files selected for processing (2)
web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useClaudeCodeChatRuntime.test.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useClaudeCodeChatRuntime.ts
|
Summary by CodeRabbit
Bug Fixes
Tests