Add per-request timeout override for long-running script executions#21
Merged
Add per-request timeout override for long-running script executions#21
Conversation
Introduces `unityctl build player` for triggering Unity player builds from the CLI. Supports standard builds (--target, --output, --scenes) and custom build code (--code, --file, stdin). The bridge translates build.player to script.execute with a 600s timeout, requiring zero Unity plugin changes. Also fixes HttpClient timeout (was 100s default) so long-running commands like builds and test runs don't race against the bridge's server-side timeouts. https://claude.ai/code/session_01QEZw9bAURLGDzf8Gfc6ocQ
Instead of a dedicated bridge command that rewrites build.player to script.execute, add an optional timeout field to RpcRequest. The CLI build command now sends script.execute with timeout=600. This is simpler and more general — any caller can override the timeout for long-running scripts without needing bridge-side plumbing per use case. https://claude.ai/code/session_01QEZw9bAURLGDzf8Gfc6ocQ
The build workflow is better left to users via script eval + timeout. Removes BuildCommands.cs and its tests. The useful part — the timeout field on RpcRequest — stays. https://claude.ai/code/session_01QEZw9bAURLGDzf8Gfc6ocQ
Reverts HttpClient.Timeout to its default (100s). When a caller passes timeoutSeconds, the CancellationTokenSource for that request is set to timeout + 30s buffer, so the bridge always gets to respond with a proper 504 before the HTTP client gives up. Normal commands keep the default behavior. https://claude.ai/code/session_01QEZw9bAURLGDzf8Gfc6ocQ
Exposes the per-request timeout override through the CLI so users can specify longer timeouts for long-running operations like player builds.
…n skill HttpClient defaults to 100s timeout which fires before the per-request CancellationTokenSource for any -t value above ~70s. Use InfiniteTimeSpan so the bridge's server-side timeout is the sole authority.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Timeoutfield toRpcRequestso callers can override the default 30s timeout per-requestBridgeClientforwards the timeout and sets an HTTP cancel budget (timeout + 30s buffer) so the bridge always responds with a proper 504 before the HTTP client throws--timeout/-tflag toscript evalandscript executeCLI commandsEnables long-running operations like player builds via
script eval:Test plan
RequestTimeoutTests.cs(override extends timeout, default still applies, errors propagate, override still times out)-t 300, times out without it--timeoutworks on bothscript evalandscript execute