fix(server): reject HTTP turn bootstrap clearly - #8633
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrow server validation fix that cleanly separates HTTP commands from WebSocket-only bootstrap commands and preserves existing valid request paths. The regression test verifies that unsupported HTTP bootstrap requests fail with a clear 400 response. You can add or adjust custom eligibility rules. Learn more. |
| Effect.fn("environment.orchestration.dispatch")(function* (args) { | ||
| yield* annotateEnvironmentRequest(args.endpoint.name); | ||
| yield* requireEnvironmentScope(AuthOrchestrationOperateScope); | ||
| if (args.payload.type === "thread.turn.start" && args.payload.bootstrap !== undefined) { |
There was a problem hiding this comment.
this is the wrong layer to do this in. there's prob many commands that are not handled over HTTP, a big inline if statement for each is not scalable
There was a problem hiding this comment.
Moved HTTP transport support into a dedicated command schema so the handler no longer needs transport-specific conditionals.
6a38fad to
3237dfa
Compare
Dismissing prior approval to re-evaluate 3237dfa
What Changed
Why
The HTTP endpoint advertised the full WebSocket command contract even though bootstrap execution only exists on the WebSocket route. A transport-specific command schema keeps support decisions in the contract and avoids a growing list of handler conditionals.
Closes #8319.
Testing
vp test run apps/server/src/server.test.ts --testNamePattern="rejects WebSocket-only turn bootstrap at the HTTP schema"vp test run packages/contracts/src/environmentHttp.test.tsvp lint packages/contracts/src/orchestration.ts packages/contracts/src/environmentHttp.ts apps/server/src/orchestration/http.ts apps/server/src/server.test.tsvp run --filter @t3tools/contracts typecheckvp run --filter t3 typecheckChecklist
mainModel: GPT-5.6 Sol
Harness: Codex in T3 Code