Fix workspace proxy dropping query parameters#173
Merged
khaliqgant merged 2 commits intomainfrom Jan 13, 2026
Merged
Conversation
Root cause: The history list used index keys as IDs, but the steps lookup
expected file internal IDs. When these differed, wrong or no data was returned.
Fixes in getTrajectoryHistory:
- Now reads trajectory file to get actual internal ID
- Uses file's ID instead of index key for consistency
- Skips duplicates based on actual ID, not index key
Fixes in listTrajectorySteps:
- Added Strategy 2: Scan index entries by file's internal ID
- This handles cases where index key != file's internal ID
- Existing fallback to active/{id}.json remains as Strategy 3
- Added logging to help debug which lookup strategy is used
The key insight: History list must use the SAME ID that the steps lookup
will find. Previously, history used index keys but steps lookup expected
file internal IDs, causing the mismatch.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Root cause: The proxy route was constructing the target URL without
preserving the query string from the original request:
const targetUrl = `${targetBaseUrl}/api/${proxyPath}`;
This meant requests like:
/api/workspaces/{id}/proxy/trajectory/steps?trajectoryId=traj_xxx
Were forwarded as:
/api/trajectory/steps (no trajectoryId!)
Without the trajectoryId parameter, the API returns ALL active trajectories
instead of the specific one requested.
Fix: Extract and append the query string to the target URL.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 My Senior Dev — Analysis Complete👤 For @khaliqgant📁 Expert in View your contributor analytics → 📊 2 files reviewed • 3 need attention
🚀 Open Interactive Review →The full interface unlocks features not available in GitHub:
💬 Chat here: 📖 View all 12 personas & slash commandsYou can interact with me by mentioning In PR comments or on any line of code:
Slash commands:
AI Personas (mention to get their perspective):
For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the trajectory viewer loading wrong data in cloud mode by preserving query parameters in the workspace proxy.
Root Cause
The workspace proxy route was constructing the target URL without the query string:
This meant requests like:
Were forwarded as:
Without the
trajectoryIdparameter, the API returns ALL active trajectories (overview) instead of the specific one.Solution
Preserve the query string when proxying:
Additional Fix
Also includes server-side ID consistency fix:
getTrajectoryHistorynow uses file's internal ID instead of index keylistTrajectoryStepsscans by file ID if index key lookup failsTest plan
[workspace-proxy] GET .../trajectory/steps?trajectoryId=...🤖 Generated with Claude Code