Repository navigation
fix(studio): declare 400 and 429 on the knowledge routes - #2313
Merged
Merged
Conversation
peppescg
approved these changes
Oct 15, 2026
peppescg
left a comment
Contributor
There was a problem hiding this comment.
Thanks Daniel. One shared constant plus a test built from the generated OpenAPI document is a good way to keep these routes in line.
Nits:
apps/server/src/routes/knowledge.ts:80: the comment says the hook andonErrorcan answer any route with "these", buterrorStatusalso mapsfailed_precondition/conflict/abortedto 409 on every route, and routes likeactOnLearnedSkill,reflectSessionandgenerateMemoryConsolidationPlandon't declare it. Either add 409 totransportErrors, or reword the comment so it doesn't claim to cover everything.apps/server/src/routes/knowledge.test.ts:279:toHaveLength(15)will fail with a bare count mismatch when #2155's/api/v1/skills/{name}/filesroute lands. Whichever PR merges second needs to add the spread and bump the count to 16.
kantord
force-pushed
the
studio-followups/03-knowledge-statuses
branch
from
October 15, 2026 09:25
efa684b to
653ddf5
Compare
The validation hook and app.onError can return both on every knowledge route, but none documented them. One shared constant now adds them to all 15 routes; the generated OpenAPI document and types follow. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
kantord
force-pushed
the
studio-followups/03-knowledge-statuses
branch
from
October 15, 2026 09:26
653ddf5 to
a47cd53
Compare
kantord
added a commit
that referenced
this pull request
Oct 15, 2026
…ard-coding the route count main's Studio job has been failing since the skill files route (#2155) landed next to the knowledge-route convention test (#2313). Each change was fine on its own: #2313 declared 400 and 429 on the 15 knowledge routes and pinned the count at 15, and #2155 added a 16th route without them. - Spread `transportErrors` into `listSkillFilesRoute` like the other knowledge routes. The OpenAPI document and generated types gain the two statuses. - The convention test no longer asserts an exact route count, so the next knowledge route is checked without editing the test. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Merged
2 tasks
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
The validation hook and
app.onErrorcan return 400 and 429 on every knowledge route, but none documented them.Part of #2303 ("Tiny follow-up fixes"); it does not close it. This is PR 3 of 14 in a stack of draft PRs, reviewed and merged in order.
What changed
transportErrorsconstant spread into all 15 knowledge routes (the issue said 16).openapi.jsonand the generated types regenerated withpnpm run generate.Behavior changes
None at runtime. The OpenAPI document and generated types gain the two statuses.
Verification
Biome, typecheck, the full Studio test suite and
pnpm generated:checkpass on this branch, run on the assembled stack. The full Playwright suite passes on the stack tip (122 passed, 30 skipped, 0 failed, includingchat-approvalagainst a realmecatedbuild). With the spreads removed, the convention test fails.Not included
Other route groups.
Size note: about 44 hand-written lines. The other ~1,500 added lines are mechanical generated output (
openapi.json,types.gen.ts), which is why generated files are excluded from the usual 500-line budget.Fully or partially written by an AI agent.
🤖 Generated with Claude Code