Skip to content

[NA] [FE] fix: assistant sidebar dev mode uses unhashed URLs#5920

Open
awkoy wants to merge 1 commit intomainfrom
awkoy/NA-assitant-dev-mode-fix
Open

[NA] [FE] fix: assistant sidebar dev mode uses unhashed URLs#5920
awkoy wants to merge 1 commit intomainfrom
awkoy/NA-assitant-dev-mode-fix

Conversation

@awkoy
Copy link
Copy Markdown
Contributor

@awkoy awkoy commented Mar 27, 2026

Details

Fix assistant sidebar dev mode: the manifest fetch returned hashed filenames (assistant.{hash}.js) that don't exist on the ollie-console dev server (which serves unhashed assistant.js). Also consolidate fragmented dev mode detection into a single source of truth.

  • New constants/assistant.ts with IS_ASSISTANT_DEV based on VITE_ASSISTANT_SIDEBAR_BASE_URL being set, replacing separate import.meta.env.DEV checks
  • Skip manifest fetch entirely in dev mode — use unhashed file paths (/assistant/assistant.js) through the Vite proxy
  • Update useAssistantBackend.ts to use the shared constant

Change checklist

  • User facing
  • Documentation update

Issues

N/A

AI-WATERMARK

AI-WATERMARK: yes

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

Testing

  • npm run lint in apps/opik-frontend — passes
  • Manual: run opik-frontend + ollie-console dev servers, verify sidebar loads with unhashed URLs
  • Network tab: no manifest.json request in dev mode
  • Production flow unchanged (manifest fetched, hashed URLs used)

Documentation

N/A

🤖 Generated with Claude Code

…le source of truth

Dev mode detection is now based on VITE_ASSISTANT_SIDEBAR_BASE_URL
instead of import.meta.env.DEV. When set, the manifest fetch is
skipped entirely and raw file paths are used through the Vite proxy.
@awkoy awkoy requested a review from a team as a code owner March 27, 2026 13:55
@github-actions
Copy link
Copy Markdown
Contributor

📋 PR Linter Failed

Missing Section. The description is missing the ## Details section.


Missing Section. The description is missing the ## Change checklist section.


Missing Section. The description is missing the ## Issues section.


Missing Section. The description is missing the ## Testing section.


Missing Section. The description is missing the ## Documentation section.

Comment on lines +184 to +188
if (IS_ASSISTANT_DEV) {
return {
scriptUrl: "/assistant/assistant.js",
cssUrl: "/assistant/assistant.css",
shellUrl: "/assistant/shell",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/assistant is hardcoded in multiple asset URLs, should we extract const ASSISTANT_STATIC_PREFIX = "/assistant" and reuse it when building those URLs?

Finding type: Extract naming constants | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
apps/opik-frontend/src/plugins/comet/AssistantSidebar.tsx around lines 184 to 188
(inside the useAssistantMeta function) and the earlier manifest return (around lines
172-175), the string "/assistant" is hardcoded for scriptUrl, cssUrl, and shellUrl.
Extract a descriptive module-level constant (for example: const ASSISTANT_STATIC_PREFIX
= "/assistant") at the top of the file and replace all hardcoded occurrences in this
file (the dev return object and the manifest-based shellUrl template) to build URLs via
`${ASSISTANT_STATIC_PREFIX}/...` or `${ASSISTANT_STATIC_PREFIX}/${manifest.shell}`.
Ensure you update both the dev branch and the manifest response to use the constant so
the prefix is consistent everywhere.

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