feat(studio): Coding agent studio linking - #236
Conversation
Signed-off-by: Danielle Ali <44468613+dmariali@users.noreply.github.com>
Signed-off-by: Danielle Ali <44468613+dmariali@users.noreply.github.com>
📝 WalkthroughWalkthroughBackend adds structured Studio context injection into Claude prompts with MCP ChangesStudio Coding Agent Bridge
Dashboard Landing Page Update
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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/api.spec.ts (1)
10-14: ⚡ Quick winConsider extracting shared BASE_URL normalization logic.
The normalization logic here duplicates
getStudioBaseUrlfromapi.ts(lines 27-29). Extract to a shared utility to avoid drift.🤖 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 `@web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/api.spec.ts` around lines 10 - 14, getExpectedStudioBaseUrl duplicates BASE_URL normalization from getStudioBaseUrl; extract the normalization into a shared utility (e.g., export a function named normalizeBaseUrl or getNormalizedBasePath that accepts BASE_URL and returns the trimmed basePath) and update both getExpectedStudioBaseUrl and getStudioBaseUrl to import and call that utility; ensure the new utility uses the same logic (strip trailing slashes and return '' for root or empty) and update imports/exports accordingly so both api.spec.ts and the module containing getStudioBaseUrl reference the single shared function.
🤖 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 `@services/studio/src/nmp/studio/coding_agents.py`:
- Around line 146-151: The StudioLinkDestination for agent_deployment is
declaring requires_name=True but its path_template
"/workspaces/{workspace}/agents" doesn't include {name}, so deployment links
never resolve to a detail page; fix by either changing the path_template in the
agent_deployment StudioLinkDestination to the real detail route that includes
{name} (e.g. "/workspaces/{workspace}/agents/{name}") so requires_name is
meaningful, or remove requires_name=True (and any detail-only alias like
"agent_deployment_detail") to make it a list-only destination; update the
StudioLinkDestination instantiation accordingly.
- Around line 803-805: Update the deployment guidance strings that currently
reference destination='agent_chat'/'agents' to point to destination='deployment'
when an agent name is known and destination='deployments' otherwise; locate the
three instruction lines that start with "If the user asks for a deployment,
deployment chat, or deployment playground link..." and replace the
agent-targeted destinations with deployment-targeted ones, leaving the
job/job(s) guidance and other studio_link destinations unchanged so generated
filesets/custom models/etc. still map to their matching studio_link
destinations.
- Line 767: The code treats an empty enabled_destinations map as falsy and falls
back to _STUDIO_LINK_DESTINATIONS; change the logic to only use the default when
enabled_destinations is None (or not provided) rather than when it's empty.
Locate occurrences where destinations = enabled_destinations or
_STUDIO_LINK_DESTINATIONS is used (e.g., the assignment at the line using
variable enabled_destinations and the similar occurrence around the other helper
at the later occurrence) and replace with an explicit None check (or explicit
emptiness check logic that preserves an intentionally empty dict) so that an
empty dict does not get interpreted as “all destinations.”
---
Nitpick comments:
In `@web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/api.spec.ts`:
- Around line 10-14: getExpectedStudioBaseUrl duplicates BASE_URL normalization
from getStudioBaseUrl; extract the normalization into a shared utility (e.g.,
export a function named normalizeBaseUrl or getNormalizedBasePath that accepts
BASE_URL and returns the trimmed basePath) and update both
getExpectedStudioBaseUrl and getStudioBaseUrl to import and call that utility;
ensure the new utility uses the same logic (strip trailing slashes and return ''
for root or empty) and update imports/exports accordingly so both api.spec.ts
and the module containing getStudioBaseUrl reference the single shared function.
🪄 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: 5dd38b2e-5c6c-4243-a27d-70e239158792
📒 Files selected for processing (13)
services/studio/src/nmp/studio/coding_agents.pyservices/studio/tests/unit/test_coding_agents.pyweb/packages/common/src/components/AssistantChat/AssistantChatThread.tsxweb/packages/common/src/components/Chat/MessageContent/index.spec.tsxweb/packages/common/src/components/Chat/MessageContent/index.tsxweb/packages/studio/src/routes/DashboardLandingRoute/index.spec.tsxweb/packages/studio/src/routes/DashboardLandingRoute/index.tsxweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeStudioLink.spec.tsxweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeStudioLink.tsxweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/api.spec.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/api.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/index.tsxweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useClaudeCodeChatRuntime.ts
|
Signed-off-by: Danielle Ali <44468613+dmariali@users.noreply.github.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeStudioLink.tsx (1)
16-19: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winAdd explicit return type for exported component.
The component is missing an explicit return type annotation. As per coding guidelines, public APIs (including React components) must have explicit return types.
♻️ Add return type annotation
-export const ClaudeCodeStudioLink = ({ href, children }: ClaudeCodeStudioLinkProps) => { +export const ClaudeCodeStudioLink = ({ href, children }: ClaudeCodeStudioLinkProps): JSX.Element => {🤖 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 `@web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeStudioLink.tsx` around lines 16 - 19, The exported React component ClaudeCodeStudioLink lacks an explicit return type; update its declaration to include a clear return annotation (for example add ": JSX.Element" after the props type or use "React.FC<ClaudeCodeStudioLinkProps>") so the public API has an explicit component return type and matches project guidelines.Source: Coding guidelines
🤖 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.
Outside diff comments:
In
`@web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeStudioLink.tsx`:
- Around line 16-19: The exported React component ClaudeCodeStudioLink lacks an
explicit return type; update its declaration to include a clear return
annotation (for example add ": JSX.Element" after the props type or use
"React.FC<ClaudeCodeStudioLinkProps>") so the public API has an explicit
component return type and matches project guidelines.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 878ff007-a433-4d65-ab58-d8eff450de34
📒 Files selected for processing (5)
services/studio/src/nmp/studio/coding_agents.pyservices/studio/tests/unit/test_coding_agents.pyweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeStudioLink.spec.tsxweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeStudioLink.tsxweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeStudioLinkTarget.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeStudioLink.spec.tsx
- services/studio/tests/unit/test_coding_agents.py
- services/studio/src/nmp/studio/coding_agents.py
Signed-off-by: Danielle Ali <44468613+dmariali@users.noreply.github.com>
Summary by CodeRabbit
New Features
Improvements