Skip to content

fix(client): generated client stale on main — check:generated red (route system field + completions 404/503 statuses missing from committed client) #1493

Closed

Description

@dezren39

Generated client is stale on main — check:generated red (route system field + completions 404/503 statuses missing from the committed client)

Verified 2026-11-03 on a clean laptop primary at main e21f70672a3f16323a73bdd3abda374a2fde21ec:

cd packages/client && bun run check:generated
# exits 1 — regeneration rewrites two committed files:
#   packages/client/src/promise/generated/client.ts  (12 lines changed)
#   packages/client/src/promise/generated/types.ts   (1 line added)

The same check passes for packages/protocol (bun run check:generated clean), so the protocol/OpenAPI layer is current and only the client generation step was skipped.

The drift, item by item

  1. Route system prompt missing from client types. packages/schema/src/config/model-routes.ts:272 declares system: Schema.String ("System prompt this route carries…", persona routes Door front migration: design-code-proxy (18746) callers repoint to the façade — personas become routes first #1413), added by commit a7bfbbcdcd (feat(routes): routes carry a system prompt + façade route failover). That commit updated the schema and packages/protocol/openapi.json, but the regenerated client type was never committed:

    export type ConfigModelRoutes = {
      [x: string]: {
        name?: string
    +   system?: string
        targets: Array<ConfigModelRouteTarget>;

    Effect: a client consumer cannot set or read a route's system prompt through the typed promise client even though the schema and the server accept it.

  2. Completions /v1/models endpoints under-declare their error statuses. packages/protocol/src/groups/completions.ts:16,30,44 declare error: [InvalidRequestError, ServiceUnavailableError, LocationNotFoundError] for the three models endpoints, and the committed packages/protocol/openapi.json lists responses 200/400/401/404/503 for GET /v1/models, GET /v1/models/{id} and GET /v1/models/{provider}/{model} (changed in commit 830a62735a, fix(facade): advertise configured model_routes at /v1/models). The committed generated client still declares only [400, 401] for all three:

    -          { method: "GET", path: `/v1/models`, successStatus: 200, declaredStatuses: [400, 401], empty: false },
    +          { method: "GET", path: `/v1/models`, successStatus: 200, declaredStatuses: [400, 401, 404, 503], empty: false },

    (same change for /v1/models/${id} and /v1/models/${provider}/${model}.) Effect: the generated transport does not declare the 404 (unknown model id — the endpoints' own docs promise "Unknown ids answer 404") or 503 responses these endpoints can return.

The committed generated client was last regenerated in a10f00161e (#1410), before both source changes.

Why CI did not catch it

.github/workflows/test.yml does have a "Check generated client" step (line 284, working-directory: packages/client), but it sits in the unit job after the "Run unit tests" step (line 248) with no if: always(), so any unit-test failure earlier in that job skips it — and the unit suite has been red on main for unrelated reasons (#1484). This is the sixth recurrence of this exact class (#450, #483, #676, #813, #1365 were the same failure with different fields). Triage should confirm the masking mechanism; if step ordering is it, moving the generated checks ahead of (or independent of) the unit-test step is part of the durable fix.

Acceptance criteria

  • cd packages/client && bun run check:generated exits 0 on main (regenerated client.ts/types.ts committed; regeneration produces no further diff).
  • Client types expose ConfigModelRoutes entries with system?: string; the three /v1/models calls declare [400, 401, 404, 503].
  • packages/client tests pass; no hand-edits inside generated files (output of bun run generate only).
  • The masking mechanism is identified on this issue; if it is the test.yml step ordering, the generated-client/documentation checks no longer sit behind the unit-test step in the same job (or the recurrence is otherwise explained and dispositioned).

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    app/clientPackage: client (pkgs/ or apps/ in this repo)
    work/self-assignedAn agent grabbed this item directly, outside the queue
    effort/xsTrivial: expected under 30 minutes of work
    on Nov 3, 2026
  2. dezren39 commented on Nov 3, 2026

    @dezren39
    Author

    🤖 Agent note · filed

    • Agent: new-issue-creator job (new-issue-creator-opencode)
    • Session / ID: cron new-issue-creator-opencode, run 2026-11-02 23:35 CST
    • Found via: filed this run
    • Task: Filed after verifying packages/client check:generated fails on clean main e21f706 (regeneration diff: route system field + completions 404/503 declared statuses missing from the committed generated client).
    • Expectation: effort/xs — regenerate the client, commit the two generated files, verify the check goes green.
    • Links: evidence in the issue body (diff, file:line, source commits a7bfbbc / 830a627)
  3. dezren39 commented on Nov 3, 2026

    @dezren39
    Author

    🤖 Agent note · picked up

    • Agent: new-issue-creator job (new-issue-creator-opencode)
    • Session / ID: cron new-issue-creator-opencode, run 2026-11-02 23:35 CST
    • Found via: self-assigned during new-issue-creator-opencode run (guarded self-solve, lifecycle protocol §4: filed this run, trivial regeneration, no safety labels)
    • Task: Regenerate the client on the laptop in a worktree (branch creator/1493-generated-client), verify check:generated exits 0 and client tests pass, open a PR, merge when verified.
    • Expectation: effort/xs — done looks like: PR merged, this issue closed by the PR, generated files byte-identical to bun run generate output.
    • Links: branch creator/1493-generated-client (PR to follow)
  4. dezren39 commented on Nov 3, 2026

    @dezren39
    Author

    🤖 Agent note · done

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/clientPackage: client (pkgs/ or apps/ in this repo)effort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions