Skip to content

fix(opencode): route agent list by directory#29472

Closed
YOMXXX wants to merge 1 commit into
anomalyco:devfrom
YOMXXX:fix/web-custom-primary-agents
Closed

fix(opencode): route agent list by directory#29472
YOMXXX wants to merge 1 commit into
anomalyco:devfrom
YOMXXX:fix/web-custom-primary-agents

Conversation

@YOMXXX
Copy link
Copy Markdown

@YOMXXX YOMXXX commented May 27, 2026

Issue for this PR

Closes #29468

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

GET /agent now stays on the local directory route before workspace lookup. This lets the web client load project custom primary agents even when the request also carries a stale workspace parameter.

The HTTP API exercise adds a regression case for /agent?directory=...&workspace=wrk_stale with a custom primary agent in project config.

How did you verify your code works?

  • bun run script/httpapi-exercise.ts --mode effect --include app.agents.custom --progress failed before the fix with Workspace not found: wrk_stale, then passed after the fix.
  • bun run test:httpapi
  • bun typecheck from packages/opencode
  • bunx prettier --check packages/opencode/src/server/routes/instance/httpapi/middleware/workspace-routing.ts packages/opencode/src/server/shared/workspace-routing.ts packages/opencode/test/server/httpapi-exercise/index.ts
  • git diff --check
  • .husky/pre-push still fails locally in unrelated @opencode-ai/console-support typecheck because Solid/Vite/generated console-core modules are missing in this checkout.

Screenshots / recordings

N/A, server/API routing behavior only.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom primary agents fail silently in web UI

2 participants