Skip to content

Route the context operations in the in-process server - #77

Merged
esnible merged 1 commit into
mainfrom
cortex-context-routes
Aug 21, 2026
Merged

Route the context operations in the in-process server#77
esnible merged 1 commit into
mainfrom
cortex-context-routes

Conversation

@esnible

@esnible esnible commented Aug 21, 2026

Copy link
Copy Markdown
Member

The /contexts paths were missing from the route table, so every rossoctl contexts command against a cortex context fell through to the mux and 404'd. They are placeholders like most of the table, but they have to be present:

before: GET .../contexts/team1/research -> 404 page not found
after:  GET .../contexts/team1/research -> 500 {"detail":"UNIMPLEMENTED"}

All four operations are affected — create, list, get, delete.

The 404 was not just the wrong code. contextListError maps a 404 to "this Rosso server does not support context infrastructure", naming the API version that introduced the resource — true of an old server, misleading for a local cortex, and it sends the reader to check their server version instead of their current context.

Covered by a new test in wire_test.go that drives the real apiclient methods rather than hand-written paths. That distinction is the point: a test requesting /contexts/ns/name directly would keep passing if the client changed the path it asks for, which is how the table fell behind. Verified to fail — naming the cause — with the four routes removed.

TestRouteTableMatchesOpenAPI's count goes 44 → 48. Its comment warns that raising it is only correct with evidence the OpenAPI document grew, so the exception is recorded rather than waved through: these four are the context resource API from rossoctl/rossoctl#2392, which postdates that document, and they are listed from the paths internal/apiclient requests.

Assisted by Claude.

The /contexts paths were absent from the route table, so every `rossoctl
contexts` command against a cortex context fell through to the mux and 404'd.
They are placeholders like most of the table, but they have to be present:

  before: GET .../contexts/team1/research -> 404 page not found
  after:  GET .../contexts/team1/research -> 500 {"detail":"UNIMPLEMENTED"}

The 404 was not merely the wrong code. contextListError maps a 404 to "this
Rosso server does not support context infrastructure", naming the API version
that introduced the resource — a true statement about an old server and a
misleading one about a local cortex, which sent the reader to check their
server's version rather than their current context. UNIMPLEMENTED is what every
other unimplemented cortex endpoint reports.

Covered by a new test in wire_test.go that drives the real apiclient methods
rather than requesting hand-written paths. That distinction is the point: a test
asking for "/contexts/ns/name" directly would keep passing if the client changed
the path it requests, which is how the table fell behind to begin with. Verified
to fail, naming the cause, with the four routes removed.

TestRouteTableMatchesOpenAPI's count goes from 44 to 48. Its comment warns that
raising the number is only correct alongside evidence the OpenAPI document grew,
so the exception is recorded rather than waved through: these four are the
context resource API from rossoctl/rossoctl#2392, which postdates that document,
and they are transcribed from the paths internal/apiclient requests. The new
test is what holds them to that.

Assisted by Claude.

Signed-off-by: Ed Snible <snible@us.ibm.com>
@esnible
esnible merged commit e855aa7 into main Aug 21, 2026
2 checks passed
@esnible
esnible deleted the cortex-context-routes branch August 21, 2026 20:18
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