Skip to content

[BUG] V1 shell tool adds undocumented +100ms to user-specified timeout #31779

Closed

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions