Repository navigation
docs: ADR 0252 — HTTP steer endpoint - #874
Conversation
samuv
left a comment
There was a problem hiding this comment.
Reviewed against the code on main (a1f987db). The decision is right and the surface it assumes does exist — worth landing. Four specifics don't match the implementation, and one of them specifies a liveness bug rather than a trade-off. Details inline.
What checks out
- 0252 is the next free number —
0251-multimodal-steeris the highest onmain. - "No change to the engine" is true.
Service.Steer(internal/adapter/server/service.go:3672) andService.CancelSteer(:3781) exist with exactly the shape assumed. stale_run_control->codes.Aborted/ 409 exists (internal/adapter/server/errorcodes.go:80), and the mapping is more complete than the ADR claims — see the note on L58.- Independence from Scenario 7 holds. HTTP handlers use hand-written body structs (
approveBody), not proto, so there's noharness.protoedit and nocontracts/gencontention withsdk/07.
Findings, severity order
- L92-99 — blocking. The promoted-run case as specified wedges the run.
Service.Steerreturns a registered run that "the caller must drain + FinishRun"; returning just a run id leaves nothing draining its event channel, and its events never reach the durable log.HTTPHandler.approvealready solves this and is the precedent to copy. - L50. The request contract drops
parts, contradicting both its own "same request contract as the gRPC frame" claim and ADR 0251 (multimodal steer). A day-one capability regression for exactly the browser clients this endpoint is for. - L67. "Discover it by 404ing" runs against the feature registry landed in #823. This is #821-family work, so by that registry's own contract it owes a row.
- L47.
steer-cancelis backwards from thecancel-childconvention the bullet cites. Minor — but the string is permanent once published.
Plus two mechanical items noted on the README line (rebase source + stale llms.txt).
Findings 1 and 2 are the ones worth fixing in the ADR text before it becomes the spec someone implements — 1 because it specifies a wedge, 2 because it locks in a regression. 3 and 4 are cheap. Not requesting changes, since none of this touches the decision itself.
Extends ADR 0232's named deferral: POST /v1/sessions/{id}/steer +
steer-cancel, mirroring approve/cancel, reusing the RFC 9457 registry
for stale-control rejection. No engine change — pure transport
addition over the existing Service.Steer/Service.CancelSteer calls.
Docs only; implementation tracked separately.
Refs #873, #821.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Per samuv's review: fix the promoted-run wedge (drain via the same approve-handler REHYDRATE precedent instead of handing back a bare run_id), carry multimodal parts in the request contract (ADR 0251), add a feature-registry row instead of discover-by-404ing (PR #823), and rename steer-cancel to cancel-steer to match the cancel-child verb-first convention. Fully or partially written by an AI agent. Co-Authored-By: Claude <[email protected]>
|
Addressed all four findings, rebased onto main:
Also regenerated Fully or partially written by an AI agent. |
Per samuv's review thread on the 409 bullet: name both refusal paths funneling through stale_run_control explicitly (an expected_run_id naming a non-current run, and strict steer's deliberate non-promotion on a terminal named run) rather than leaving the second implicit. Fully or partially written by an AI agent. Co-Authored-By: Claude <[email protected]>
Per samuv's review thread: state explicitly that steer parts reuse toContentParts/session.NewContent/ValidateMediaParts and the same ProviderCapabilities() gate as the ACP prompt path, not a second validation path. Fully or partially written by an AI agent. Co-Authored-By: Claude <[email protected]>
samuv
left a comment
There was a problem hiding this comment.
Approving — all six findings from my earlier review are addressed, and I verified the fixes against the code rather than the replies.
- Promoted-run wedge (the blocking one): the new bullet quotes
Service.Steer's own "must drain + FinishRun" and followsHTTPHandler.approve's REHYDRATE precedent — flusher →relayRunSSE, no flusher → background drain intoNewRunEventRecorder+ deregister + ack. The promoted run's events now reach the durable log either way. - Multimodal:
partsadded, routed throughtoContentParts→session.NewContent+session.ValidateMediaParts, gated by the sameProviderCapabilities()check the ACP prompt path uses. No second validation path. - Discoverability:
FeatureHTTPSteer = "http_steer"inallFeatures; the 404-probing line is gone. - Route naming:
cancel-steer, and it now states the rule ("the verb leads, the noun follows") rather than only citing the precedent. - The two refusals: spelled out, and it flags case 2 as the one that inverts the promotion default described later in the same document — clearer than what I asked for.
- Mechanical: rebased,
llms.txtregenerated.
Two things worth calling out beyond the checklist. First, the Consequences section was corrected alongside the Decision — I hadn't asked for that, and skipping it would have left the document contradicting itself (the old bullet declared the wedge an accepted cost). The residual it now states — that a client wanting to keep watching the promoted run past this response still polls/attaches, "not a correctness gap" — is accurate. Second, all six newly-cited symbols exist in non-test code, go test ./docs/lint/... passes, and CI is green across all seven non-skipped checks including Docs (matlatl).
One narrow thing left for the implementing PR (#873), not a blocker on the decision record: on the promoted + flusher path the response body is text/event-stream, so there is nowhere for the 200 JSON SteerOutcome body this ADR promises — yet that is precisely the path where a client most needs too_late + promoted + the new run id. relayRunSSE already takes a notice parameter that emits a pre-flight event ahead of the run's own stream (the prompt path passes RecoverNotice through it), so the mechanism exists; it just needs naming somewhere. Arguably an implementation detail rather than an ADR-level decision, which is why it is not blocking here.
Per samuv's review: fix the "over HTTP" transport category error (the vendored automocker covers unary gRPC, not the hand-written JSON HTTP endpoints), name the sdk/typescript/ ordering dependency on #821 and the missing TS CI gate, correct #618's tense (open, not merged) and adopt its SPDX-guard pattern scoped to sdk/, and record the header rewrite as an authorized relicense (Stacklok holds copyright on both sides) rather than a bare header edit. Also reframes scope explicitly: the SDK's own testability (near-term deadline) and Studio's eventual HTTP/JSON mocking needs (later, architecture undecided) are separate, coexisting concerns. This ADR only needs to unblock the former. Rebased onto main (#874 merged) and regenerated llms.txt. Fully or partially written by an AI agent. Co-Authored-By: Claude <[email protected]>
* docs: ADR 0253 — SDK mocking testkit Vendor (not npm-depend on) the proven unary Connect-RPC handler pattern + AutoAPIMock core; defer streaming/bidi mocking (Converse, the stale-run-control race) as a named residual. Lives inside mecatl's own SDK tree for now, no shared package yet. Docs only; implementation tracked separately. Refs #872. Co-Authored-By: Claude Sonnet 5 <[email protected]> * docs: address review feedback on ADR 0253, rebase onto main Per samuv's review: fix the "over HTTP" transport category error (the vendored automocker covers unary gRPC, not the hand-written JSON HTTP endpoints), name the sdk/typescript/ ordering dependency on #821 and the missing TS CI gate, correct #618's tense (open, not merged) and adopt its SPDX-guard pattern scoped to sdk/, and record the header rewrite as an authorized relicense (Stacklok holds copyright on both sides) rather than a bare header edit. Also reframes scope explicitly: the SDK's own testability (near-term deadline) and Studio's eventual HTTP/JSON mocking needs (later, architecture undecided) are separate, coexisting concerns. This ADR only needs to unblock the former. Rebased onto main (#874 merged) and regenerated llms.txt. Fully or partially written by an AI agent. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude Sonnet 5 <[email protected]>
What
The decision record for the HTTP steer endpoint follow-up ADR 0232 named on the way out. Docs only — no production code.
Adds ADR 0252 and its index entry.
Why
Mid-run steer is gRPC-only today. ADR 0232 states this explicitly:
approveandcancelalready have unary HTTP endpoints; steer does not — not because of a hard limit, just because the "cheap follow-up" was never filed as tracked work. It now is: #873.The decision
POST /v1/sessions/{id}/steer+POST /v1/sessions/{id}/steer-cancel, mirroring the existingapprove/cancelHTTP routes and thecancel-childhyphenation convention.message_id, optionalexpected_run_id).SteerOutcomeenum over HTTP as the gRPC ack; a staleexpected_run_idis a409application/problem+json, codestale_run_control, reusing the ADR 0248 registry.Service.Steer/Service.CancelSteercalls. The steer inbox, mutex, and promote-on-terminal-race mechanics in ADR 0232 are untouched.run_id; the client polls/attaches separately to follow it. Not mandating a specific attach mechanism keeps this small endpoint independent of Scenario 7 (WatchSessionEvents, not yet built).Verification
go test ./docs/lint/...— green.task testis unaffected.Refs #873, #821.
Fully or partially written by an AI agent.