Skip to content

fix(studio): Fix simultaneous user requests not being shown on the Code Agent#473

Merged
htolentino-nvidia merged 1 commit into
mainfrom
studio-code-agent-simultaneus-inputs/htolentino
Jun 26, 2026
Merged

fix(studio): Fix simultaneous user requests not being shown on the Code Agent#473
htolentino-nvidia merged 1 commit into
mainfrom
studio-code-agent-simultaneus-inputs/htolentino

Conversation

@htolentino-nvidia

@htolentino-nvidia htolentino-nvidia commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of queued permission and input prompts so only one request is active at a time and the next request appears in order.
    • Made multi-step question flows progress more reliably, with responses preserved until the final submission.
    • Reset and navigation actions now clear pending prompts more consistently.
  • Tests

    • Updated coverage to verify the revised queued-vs-active prompt behavior.

@htolentino-nvidia htolentino-nvidia requested review from a team as code owners June 25, 2026 20:25
@github-actions github-actions Bot added the fix label Jun 25, 2026
… the same time

Signed-off-by: Henrique Tolentino <htolentino@nvidia.com>
@htolentino-nvidia htolentino-nvidia force-pushed the studio-code-agent-simultaneus-inputs/htolentino branch from 896e365 to eab8e5f Compare June 25, 2026 20:26
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Refactors useClaudeCodeChatRuntime to manage permission and input blocking through a FIFO reducer, with updated request resolution, run/navigation resets, and concurrency test expectations.

Changes

Claude Code chat runtime refactor

Layer / File(s) Summary
Blocking request model and reducer
web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useClaudeCodeChatRuntime.ts
Adds queued request types, ask-user-question parsing updates, workspace artifact shaping, and reducer-managed decision/input state.
Run and navigation lifecycle
web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useClaudeCodeChatRuntime.ts
Resets blocking state during navigation-decision setup, run start, and run cleanup, and clears the navigation request on cleanup.
Request resolution and queue tests
web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useClaudeCodeChatRuntime.ts, web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useClaudeCodeChatRuntime.test.ts
Reworks input and decision resolution to use reducer state, advances ask-user-question steps, resets session state, updates the runtime return shape, and adjusts queue-order assertions.

Possibly related PRs

  • NVIDIA-NeMo/nemo-platform#257: Introduces the input_request and resolveClaudeCodeInput flow that this PR now routes through the reducer-backed queue.
  • NVIDIA-NeMo/nemo-platform#155: Updates the approval/decision flow in the same runtime hook that this PR refactors into reducer-driven permission handling.
  • NVIDIA-NeMo/nemo-platform#435: Modifies the same runtime lifecycle around pre-run navigation state clearing that this PR also resets.

Suggested reviewers

  • dmariali
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: queued handling for simultaneous user requests in the Code Agent.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch studio-code-agent-simultaneus-inputs/htolentino

Comment @coderabbitai help to get the list of available commands.

@htolentino-nvidia

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review now, please!

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

@htolentino-nvidia Reviewing now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6bced94 and eab8e5f.

📒 Files selected for processing (2)
  • web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useClaudeCodeChatRuntime.test.ts
  • web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useClaudeCodeChatRuntime.ts

@github-actions

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 20911/27483 76.1% 61.2%
Integration Tests 12109/26252 46.1% 19.5%

@htolentino-nvidia htolentino-nvidia added this pull request to the merge queue Jun 26, 2026
Merged via the queue into main with commit 3746145 Jun 26, 2026
53 checks passed
@htolentino-nvidia htolentino-nvidia deleted the studio-code-agent-simultaneus-inputs/htolentino branch June 26, 2026 13:47
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.

2 participants