Skip to content

Fix remaining API route mismatches from OpenAPI migration#532

Merged
jamiepine merged 3 commits intomainfrom
fix/remaining-api-route-mismatches
Apr 4, 2026
Merged

Fix remaining API route mismatches from OpenAPI migration#532
jamiepine merged 3 commits intomainfrom
fix/remaining-api-route-mismatches

Conversation

@jamiepine
Copy link
Copy Markdown
Member

@jamiepine jamiepine commented Apr 4, 2026

Summary

  • Fix 9 more frontend→backend route mismatches introduced during the OpenAPI migration
  • Prompt inspect: /channels/inspect/*/channels/prompt/*
  • Cancel process: /channels/cancel/channels/cancel-process
  • Update check/apply: /update/check/update-check, /update/apply/update-apply
  • Groups & humans: /groups/links/groups, /humans/links/humans

Test plan

  • Prompt inspector loads and capture toggle works
  • Cancel process button works on active workers
  • Update check/apply in settings works
  • Groups and humans CRUD in topology settings works

Note

This PR consolidates 9 API route fixes across the prompt inspection, process cancellation, update management, and topology management endpoints. The new audit script extracts and compares frontend routes against backend route annotations to prevent future divergence. Changes are isolated to the frontend client and the new audit tooling—no backend route changes are included.

Written by Tembo for commit eba3c4a. This will update automatically on new commits.

- `/channels/inspect` → `/channels/prompt/inspect`
- `/channels/inspect/capture` → `/channels/prompt/capture`
- `/channels/inspect/snapshots` → `/channels/prompt/snapshots`
- `/channels/inspect/snapshot` → `/channels/prompt/snapshots/get`
- `/channels/cancel` → `/channels/cancel-process`
- `/update/check` → `/update-check`
- `/update/apply` → `/update-apply`
- `/groups` → `/links/groups`
- `/humans` → `/links/humans`

Also adds scripts/audit-routes.sh to diff frontend vs backend routes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 4, 2026

Walkthrough

API endpoint paths in the client were updated to match new backend routing conventions, including prompt inspection, process cancellation, update checks, and agent topology endpoints. Additionally, a modal dialog's width styling was adjusted from max-width constraints to explicit viewport-relative sizing.

Changes

Cohort / File(s) Summary
API Client Routing Updates
interface/src/api/client.ts
Refactored multiple endpoint paths: prompt operations moved to /channels/prompt/*, process cancellation to /channels/cancel-process, update checks to /update-check and /update-apply, and agent topology calls to /links/groups* and /links/humans* namespaces.
Modal Dialog Styling
interface/src/components/PromptInspectModal.tsx
Replaced max-width constraint max-w-5xl with explicit viewport-relative sizing w-[80vw] and max-w-[80vw] for DialogContent.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing API route mismatches from the OpenAPI migration, which is the primary focus of the changeset.
Description check ✅ Passed The PR description clearly documents the 9 API route mismatches being fixed, provides specific before/after mappings, includes a detailed test plan, and explains the broader context of the OpenAPI migration fixes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remaining-api-route-mismatches

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/audit-routes.sh`:
- Around line 13-30: The extract_frontend_routes function is missing fetchJson
template-literal routes and the later presence check uses substring matching;
update extract_frontend_routes to also match fetchJson`...` backtick template
literals (in addition to fetchJson<...>("...")) and normalize those captures the
same way, and change any downstream presence test that uses grep -qF to an
exact-line match (e.g., full-line/exact-string check) so routes like
/links/groups don't falsely match /links/groups/{param}; reference
extract_frontend_routes and all grep/grep -qF usages in the script to update the
regexes and the presence-check behavior accordingly.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 02f5c379-b085-4ac0-b5db-b47db5c9904e

📥 Commits

Reviewing files that changed from the base of the PR and between f7e9d87 and eba3c4a.

📒 Files selected for processing (2)
  • interface/src/api/client.ts
  • scripts/audit-routes.sh

@jamiepine jamiepine merged commit a7766a4 into main Apr 4, 2026
4 checks passed
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.

1 participant