Skip to content

[NA][FE] fix: include workspace name in agent onboarding prompt#5923

Open
AndreiCautisanu wants to merge 1 commit intomainfrom
andreicautisanu/OPIK-5020-add-workspace-to-onboarding-prompt
Open

[NA][FE] fix: include workspace name in agent onboarding prompt#5923
AndreiCautisanu wants to merge 1 commit intomainfrom
andreicautisanu/OPIK-5020-add-workspace-to-onboarding-prompt

Conversation

@AndreiCautisanu
Copy link
Copy Markdown
Contributor

Details

The agent onboarding "Install with AI" prompt includes the project name and API key but not the workspace name. Without OPIK_WORKSPACE, the SDK defaults to "default" which causes 401 User not allowed to access workspace errors on Opik Cloud.

This adds the active workspace name to the generated prompt so the coding agent sets OPIK_WORKSPACE correctly.

Change checklist

  • User facing
  • Documentation update

Issues

  • OPIK-5020

AI-WATERMARK

AI-WATERMARK: yes

  • Tools: Claude Code
  • Model(s): Claude Opus 4.6
  • Scope: assisted
  • Human verification: code review + manual testing

Testing

  • cd apps/opik-frontend && npm run lint — passes
  • Verified prompt renders as: Instrument my agent with Opik, use project name "X", workspace "Y" and API key "Z". Once you are ready...

Documentation

N/A

Companion PR for opik-skills: https://github.com/comet-ml/opik-skills/pull/2

Without the workspace, the SDK defaults to "default" which causes
401 errors on Opik Cloud.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@AndreiCautisanu AndreiCautisanu changed the title [OPIK-5020] [FE] fix: include workspace name in agent onboarding prompt [FE] fix: include workspace name in agent onboarding prompt Mar 27, 2026
@AndreiCautisanu AndreiCautisanu changed the title [FE] fix: include workspace name in agent onboarding prompt [NA][FE] fix: include workspace name in agent onboarding prompt Mar 27, 2026
@JetoPistola
Copy link
Copy Markdown
Contributor

💡 suggestion | Completeness

The ManualIntegrationList.tsx component displays copyable "Project name" and "API key" fields but doesn't include the workspace name. The same reasoning that motivated adding workspace to the AI prompt applies here — without it, users doing manual integration will default to "default" and hit 401 on multi-workspace setups.

Consider adding a workspace name field alongside the existing ones, using the same useActiveWorkspaceName hook.


👋 Review summary

What looks good

  • Minimal, surgical fix — one hook import, one variable, one conditional insertion
  • Graceful handling of the falsy workspace case preserves backward compatibility
  • Good use of the existing useActiveWorkspaceName hook rather than threading workspace through props

Overall
Clean fix for a real user-facing bug. The prompt now correctly includes workspace context for Opik Cloud users, preventing 401 errors from the SDK defaulting to "default". This shouldn't be blocked by the suggestion above — the manual integration list can be addressed in a follow-up.

Inline comments: 1 suggestion (non-blocking, follow-up scope)

🤖 Review posted via /review-github-pr

Copy link
Copy Markdown
Contributor

@JetoPistola JetoPistola left a comment

Choose a reason for hiding this comment

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

Looks good — clean, minimal fix. The workspace suggestion for ManualIntegrationList can be a follow-up.


const buildPrompt = (shouldMaskAPIKey: boolean) =>
`Instrument my agent with Opik, use project name "${agentName}"${
workspaceName ? `, workspace "${workspaceName}"` : ""
Copy link
Copy Markdown
Contributor

@JetoPistola JetoPistola Mar 29, 2026

Choose a reason for hiding this comment

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

Suggested change
workspaceName ? `, workspace "${workspaceName}"` : ""
workspaceName ? `, workspace name "${workspaceName}"` : ""

Since it's not an ID, we should have it be name

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