Skip to content

feat(server): unary HTTP steer + cancel-steer endpoints (ADR 0252) - #967

Open
jtenniswood wants to merge 1 commit into
studio/S01from
studio/S02
Open

jtenniswood wants to merge 1 commit into
studio/S01from
studio/S02

Conversation

@jtenniswood

Copy link
Copy Markdown
Contributor

Stack 2/21 — HTTP steer + cancel-steer endpoints (ADR 0252)

The only daemon-side Go change in the whole #618 series — landing at the bottom of the stack so every remaining PR is pure TypeScript/config/docs. Independently valuable beyond Studio (#873, TS SDK #821).

What it adds (per ADR 0252, status flipped Proposed → Accepted here):

  • POST /v1/sessions/{id}/steer — unary steer into the live run's inbox via the same Service.Steer the gRPC frame uses: text and/or multimodal parts through the existing toContentParts choke point, optional strict expected_run_id (mismatch/terminal → 409 stale_run_control), promote-and-relay as SSE when no live run can take it (background-drain into the durable event log behind a {"outcome":"too_late","promoted":true} ack when the writer cannot stream).
  • POST /v1/sessions/{id}/cancel-steer — retracts the pending (un-drained) steer (retracted / none_pending).
  • features.go registry row http_steer — clients feature-detect instead of sniffing.

Two deliberate deviations from the original branch, called out for review:

  1. Service.SteerEnqueue is deleted, not carried. At the branch tip it was production-dead (the HTTP handler calls Service.Steer; zero callers remained) — replaying it would land dead exported surface. The classification table's Steer rationale is corrected accordingly.
  2. The steer-cancel deprecated alias is dropped. No released client ever called it (Studio already uses the canonical cancel-steer); the ~6 test sites that exercised the alias path now exercise the canonical route, and the stale never-promotes package comment on steer_http_test.go is corrected to the promote-and-relay contract that actually shipped.

Docs, same PR per repo rule: docs/usage/http-sse-api.md steer section, docs/architecture/api-surface.md rows (corrected from the branch's steer-cancel naming drift to the registered routes), IMPLEMENTATION-NOTES steer wire section, user-docs/building/deployment/grpc-http.md, llms.txt regenerated.

No engine/ or contracts/ changes — no api-compat or buf surface. task lint && task test green.

🤖 Generated with Claude Code

POST /v1/sessions/{id}/steer enqueues text and/or multimodal parts (through
the existing toContentParts choke point) into the live run's steer inbox via
Service.Steer, with an optional strict expected_run_id (mismatch or a named
terminal run answers 409 stale_run_control); when no live run can take an
unqualified steer it promotes through the run-entry funnel and relays the
follow-up run as SSE on the same response, or background-drains into the
durable event log behind a {"outcome":"too_late","promoted":true} ack when
the writer cannot stream. POST /v1/sessions/{id}/cancel-steer retracts the
pending (un-drained) steer. The pair self-describes as http_steer in the
feature registry so clients feature-detect instead of sniffing.

Two deliberate departures from the feat/studio-atrium branch this is carved
from: Service.SteerEnqueue is deleted rather than carried (production-dead —
the handler calls Service.Steer; zero callers remained) with the
classification rationale corrected, and the never-shipped steer-cancel alias
is dropped (no released client called it; the tests now exercise the
canonical route, and the stale never-promotes package comment is corrected).

Docs in the same change per repo rule: the http-sse-api steer section,
api-surface rows (corrected to the registered cancel-steer naming),
IMPLEMENTATION-NOTES wire section, user-docs grpc-http, ADR 0252 flipped
Proposed→Accepted, llms.txt regenerated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jtenniswood jtenniswood added documentation Improvements or additions to documentation enhancement New feature or request backend-service-gap WebUI feature that needs a new backend service built behind it labels Sep 2, 2026

This branch has not been deployed

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

Labels

backend-service-gap WebUI feature that needs a new backend service built behind it documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant