Description
packages/opencode/src/tool/shell.ts:550 adds an undocumented 100ms grace period to every timeout:
const timeout = Effect.sleep(`${input.timeout + 100} millis`)
If a user sets timeout: 5000, the actual timeout is 5100ms - the command can run 100ms longer than requested. For short timeouts (e.g., timeout: 100), the error is 100% (becomes 200ms).
Root Cause
The + 100 appears to have been added as a race buffer to prevent premature timeout, but it's undocumented and modifies the user-specified timeout without telling them.
OpenCode version
1.17.3
Description
packages/opencode/src/tool/shell.ts:550adds an undocumented 100ms grace period to every timeout:If a user sets
timeout: 5000, the actual timeout is 5100ms - the command can run 100ms longer than requested. For short timeouts (e.g.,timeout: 100), the error is 100% (becomes 200ms).Root Cause
The
+ 100appears to have been added as a race buffer to prevent premature timeout, but it's undocumented and modifies the user-specified timeout without telling them.OpenCode version
1.17.3