You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
KubectlTransport has no default deadline while GrpcRelayTransport always applies 120s, and the battery cannot see it #182
The two per-call transports disagree on what happens to a command with no explicit timeout, and the disagreement is invisible to the conformance battery.
packages/k8s-sandbox/src/exec.ts arms a timer only when the caller passes opts.timeout > 0. With no timeout, the kubectl exec child runs until it finishes.
packages/k8s-sandbox/src/grpc-relay-transport.ts applies DEFAULT_DEADLINE_MS = 120_000unconditionally, so any exec without an explicit timeout is cancelled at 120 s with timeout:120.
Pi's bash tool documents no default timeout (pi-fork/packages/coding-agent/src/core/tools/bash.ts), so a model-issued bash with none runs unbounded on the in-cluster pod path and dies after two minutes on the remote-worker path. A pnpm install, a full test run, or a long build crosses that line routinely.
The shared conformance battery cannot catch this: its timeout case always passes an explicit timeout (packages/k8s-sandbox/test/conformance.ts), so neither transport's default is ever exercised. The battery's green status therefore does not speak to this divergence at all — which is worth noting, because that battery is the evidence behind the epic's transport-swappability claim (#89, driver #2).
Recorded in spec §8's "Accepted divergences" pending this decision. Found by the whole-branch review of the epic-closing work.
The decision
Give KubectlTransport the same 120 s default. Makes the transports agree. Cost: commands that work today on the pod path start dying at two minutes — a real regression for legitimate long-running work, and the kind that surfaces as a confusing mid-build failure.
Raise or remove the gRPC default. Removing it means the harness can hang on a silent or malicious worker, which is the specific thing §8's dual-ended timeout exists to prevent — so this is really "raise it", and then to what?
Keep them different, deliberately, and add a battery case asserting each transport's documented default. The divergence stops being accidental and starts being tested; the docs already state it.
Whatever is chosen, option 3's test belongs in it — right now nothing pins either default, so both could drift silently.
Refs
Epic #89 · spec §8 "Accepted divergences" and its dual-ended timeout bullet · related #180, #181.
Decided and done in #226 (0beed53, 22d696b), merged as 1b5d4ef.
None of the three options as written. The chosen shape is one generous ceiling on every transport: DEFAULT_EXEC_TIMEOUT_S (30 minutes) now lives beside DEFAULT_OUTPUT_CAP in transport.ts and is applied by all three implementations.
What changed the framing. This issue reads as "the pod path has no default, so give it the relay's 120 s" (option 1 first). Checking Pi inverts that:
pi-fork/packages/coding-agent/src/core/tools/bash.ts:26 declares timeout as Type.Optional, described literally as "Timeout in seconds (optional, no default timeout)" — so the model omitting it is the ordinary case, not an edge one.
Pi's own local bash executor (bash.ts:95) arms a timer only if (timeout !== undefined && timeout > 0).
So KubectlTransport and persistentExecInPod matched Pi, and GrpcRelayTransport was the outlier. Option 1 would have made all three agree by making all three contradict the tool description the model reads, and started killing legitimate long work at two minutes on every path — a regression the issue correctly names as its cost.
Option 2's objection stands too, and this addresses it: the ceiling exists precisely so a silent or hostile worker cannot hang the harness. It's set generously because a cold npm ci, a full test suite or a container build routinely outruns two minutes, and 120 s was low enough to fail those on the remote path only. It is there to stop a slot leaking forever, not to police runtime. Callers that know better still pass their own timeout, and an explicit timeout: 0 opts out — now uniformly, where before 0 disarmed the timer on two transports and silently fell back to the 120 s deadline on the third.
Option 3's test is in it, as you required. Two conformance cases run against all three transports: the default applies when no timeout is named (asserting the exec is still pending just short of the ceiling, so a transport that timed out early — or armed 120 s — cannot pass), and an explicit 0 arms nothing. Verified failing for KubectlTransport with its old unbounded behaviour restored.
The dual-ended timeout is now genuinely dual-ended. Review caught that the ceiling was armed harness-side only while the request still carried timeout_s: 0, and remote-worker/internal/exec/runner.go:117 arms its timer solely when TimeoutS > 0 — its comment at runner.go:46 spells out the TimeoutS == 0 outlives-us case. On the two kubectl transports the timer and the child share a process so the ceiling can't be orphaned; on this one a harness that exits, a dropped connection, or an abort that never lands would leave the remote process running with nothing left to stop it. Both ends now hold the same budget independently, pinned by three cases in grpc-relay-transport.test.ts — the conformance battery asserts what the caller observes, which cannot distinguish a ceiling both ends enforce from one only we do.
One loose end this leaves, worth its own issue.docs/specs/2026-07-08-sandbox-transport-grpc-design.md §8 "Accepted divergences" still records this as an open divergence:
No default deadline on the kubectl path.KubectlTransport arms a timer only when opts.timeout > 0; GrpcRelayTransport always applies DEFAULT_DEADLINE_MS (120 s). […] The conformance battery cannot see this: its timeout case always passes an explicit timeout.
All three sentences are now false: the kubectl path has a default, the relay no longer applies 120 s, and the battery does see it. #226 didn't touch that spec. Happy to send the doc update as a small follow-up.
The spec follow-up flagged above is #227: §8's divergence entry deleted (as the #181/#185 entries were when they resolved), the resulting contract stated in the dual-ended timeout bullet, and a Revisions entry in ADR-0024 with the three rejected alternatives.
Activity
docs: the output cap is now a seam-wide guarantee
fix(k8s-sandbox): send the exec ceiling on the wire, not just harness…
fix(k8s-sandbox): give all three transports one default exec timeout (#…
Merge pull request #226 from pdettori/fix/issue-triage-first-session
pdettori commentedon Sep 6, 2026
Decided and done in #226 (
0beed53,22d696b), merged as1b5d4ef.None of the three options as written. The chosen shape is one generous ceiling on every transport:
DEFAULT_EXEC_TIMEOUT_S(30 minutes) now lives besideDEFAULT_OUTPUT_CAPintransport.tsand is applied by all three implementations.What changed the framing. This issue reads as "the pod path has no default, so give it the relay's 120 s" (option 1 first). Checking Pi inverts that:
pi-fork/packages/coding-agent/src/core/tools/bash.ts:26declarestimeoutasType.Optional, described literally as "Timeout in seconds (optional, no default timeout)" — so the model omitting it is the ordinary case, not an edge one.bash.ts:95) arms a timer onlyif (timeout !== undefined && timeout > 0).So
KubectlTransportandpersistentExecInPodmatched Pi, andGrpcRelayTransportwas the outlier. Option 1 would have made all three agree by making all three contradict the tool description the model reads, and started killing legitimate long work at two minutes on every path — a regression the issue correctly names as its cost.Option 2's objection stands too, and this addresses it: the ceiling exists precisely so a silent or hostile worker cannot hang the harness. It's set generously because a cold
npm ci, a full test suite or a container build routinely outruns two minutes, and 120 s was low enough to fail those on the remote path only. It is there to stop a slot leaking forever, not to police runtime. Callers that know better still pass their owntimeout, and an explicittimeout: 0opts out — now uniformly, where before0disarmed the timer on two transports and silently fell back to the 120 s deadline on the third.Option 3's test is in it, as you required. Two conformance cases run against all three transports: the default applies when no timeout is named (asserting the exec is still pending just short of the ceiling, so a transport that timed out early — or armed 120 s — cannot pass), and an explicit
0arms nothing. Verified failing forKubectlTransportwith its old unbounded behaviour restored.The dual-ended timeout is now genuinely dual-ended. Review caught that the ceiling was armed harness-side only while the request still carried
timeout_s: 0, andremote-worker/internal/exec/runner.go:117arms its timer solely whenTimeoutS > 0— its comment atrunner.go:46spells out theTimeoutS == 0outlives-us case. On the two kubectl transports the timer and the child share a process so the ceiling can't be orphaned; on this one a harness that exits, a dropped connection, or anabortthat never lands would leave the remote process running with nothing left to stop it. Both ends now hold the same budget independently, pinned by three cases ingrpc-relay-transport.test.ts— the conformance battery asserts what the caller observes, which cannot distinguish a ceiling both ends enforce from one only we do.One loose end this leaves, worth its own issue.
docs/specs/2026-07-08-sandbox-transport-grpc-design.md§8 "Accepted divergences" still records this as an open divergence:All three sentences are now false: the kubectl path has a default, the relay no longer applies 120 s, and the battery does see it. #226 didn't touch that spec. Happy to send the doc update as a small follow-up.
pdettori commentedon Sep 6, 2026
The spec follow-up flagged above is #227: §8's divergence entry deleted (as the #181/#185 entries were when they resolved), the resulting contract stated in the dual-ended timeout bullet, and a Revisions entry in ADR-0024 with the three rejected alternatives.
docs(spec): close #182's accepted divergence in §8 and ADR-0024
Merge pull request #227 from pdettori/docs/close-182-divergence
fix(worker): reserve outbound capacity for terminal frames (#173 item 1)
refactor(worker): address PR rossoctl#232 review — return the claim o…
fix(transport): derive the gRPC message ceiling from the output cap (#…
fix(vmpool): an Exec that named no timeout was bounded by nothing