Skip to content

feat(server): add HTTP steer controls - #1407

Merged
samuv merged 3 commits into
mainfrom
t3code/evaluate-issue-873
Sep 11, 2026
Merged

samuv merged 3 commits into
mainfrom
t3code/evaluate-issue-873

Conversation

@samuv

@samuv samuv commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add unary HTTP steer and cancel-steer endpoints with strict, bounded request decoding
  • centralize expected-run and message-ID validation across HTTP and gRPC controls
  • drain promoted follow-up runs in the background while persisting their events and awaiting state
  • share steer watermark projection across HTTP and gRPC, advertise http_steer, and enable the TypeScript SDK transport
  • accept ADR 0252 and update architecture and user-facing API documentation

Testing

  • task lint
  • task test
  • task sdk:test
  • task sdk:typecheck
  • task sdk:lint
  • git diff --check

Closes #873

@samuv
samuv force-pushed the t3code/evaluate-issue-873 branch from 4c81ef7 to fa3bcc4 Compare September 11, 2026 12:04
@samuv samuv self-assigned this Sep 11, 2026

@jhrozek jhrozek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Panel review (Spec + Standards + Test adequacy + Domain: secure-code-reviewer, software-architect, go-architect, code-duplication-reviewer, library-reuse-reviewer). Approving per author request; inline notes below track the findings so they don't get lost. The approveLiveRun item is the one I'd genuinely want a fast follow-up on — it's a real, demonstrated race in a permission-verdict path, even though it's scoped narrowly.

Summary:

  • Spec: docs/adr/0232-steer-while-running.md's own "Fragility (recorded deliberately)" paragraph explicitly predicts this PR ("a second sender surface (e.g. the deferred HTTP/SSE steer endpoint) lands") and prescribes moving message-id correlation into the engine inbox as a {text, id} pair "rather than growing a heuristic at the wire layer." This PR instead extends the Service-level steerMsgIDs FIFO to serve both transports (likely sound, since both transports append under the same s.mu critical section — but ADR 0232 wasn't touched, so that paragraph now reads as an open warning about a decision that was actually made and shipped). Worth a follow-up updating ADR 0232 (or ADR 0252) to state the same-critical-section rationale explicitly. The bundled persistMu/resolvedAskID/cancelSignaled commit also isn't called out anywhere as caused-by-this-PR.
  • Test adequacy: no interleaving/regression test proves the persistMu serialization fix actually does anything (current test is sequential, would pass reverted).
  • Domain: approveLiveRun is missing the s.runs[id] != st re-check its sibling cancelLiveRun has — go-architect traced a concrete window where a verdict can land on an orphaned, deregistered run while the caller is told it succeeded. Plus a couple of small duplication/dead-code cleanups.

PANEL: ship_blockers=0 important=4 advisory=8 reviewer_failures=0

Comment thread internal/adapter/server/service.go Resolved
Comment thread internal/adapter/server/http.go Resolved
Comment thread internal/adapter/server/http.go Resolved
@samuv
samuv merged commit ab3d8df into main Sep 11, 2026
33 checks passed
@samuv
samuv deleted the t3code/evaluate-issue-873 branch September 11, 2026 14:34
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Sep 11, 2026
2 tasks
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.

feat(server): add HTTP POST /v1/sessions/{id}/steer (mirroring approve/cancel)

2 participants