fix(session): validate broker runtime boundaries - #903
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThe PR centralizes strict runtime parsing for broker registration, snapshots, commands, daemon envelopes, capabilities, health data, and Hunk client responses. It also adds malformed-input, parser-failure, atomicity, and compatibility coverage.
Confidence Score: 4/5The PR should not merge until accepted dispatch deadlines and idempotency keys are either enforced end-to-end or rejected instead of being silently ignored. The new public parser accepts execution-control fields, but the daemon omits them when dispatching, so callers can observe commands executing despite expired deadlines or duplicate idempotency keys. Files Needing Attention: packages/session-broker/src/protocolParsers.ts, packages/session-broker/src/daemon.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant Daemon
participant Registry as Protocol parser registry
participant Broker
participant App
Caller->>Daemon: Authenticated JSON dispatch
Daemon->>Registry: Parse structural request
Registry-->>Daemon: Selector, command, input, controls
Daemon->>Broker: Dispatch parsed command
Broker->>Registry: Parse command input
Broker->>App: Validated WebSocket command
App->>Registry: Parse command result
App-->>Broker: Validated result
Broker-->>Daemon: Resolve pending request
Daemon-->>Caller: Authenticated response
Prompt To Fix All With AI### Issue 1
packages/session-broker/src/protocolParsers.ts:325-330
**Dispatch controls are discarded**
When an authenticated caller supplies an expired `deadline` or an `idempotencyKey`, this parser accepts both fields but the daemon omits them from `dispatchCommand`, causing expired requests to execute and duplicate requests to run independently without indicating that their controls were ignored.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(session): validate broker runtime bo..." | Re-trigger Greptile |
0cb1a10 to
d2a2336
Compare
bba569a to
3740446
Compare
Summary
Validation
bun run lintbun run typecheckbun run deps:checkgit diff --checkStack
This PR description was generated by Pi using gpt-5.6-sol