Skip to content

Add per-request timeout override for long-running script executions#21

Merged
Niaobu merged 6 commits intomainfrom
claude/unityctl-build-command-afaoA
Feb 19, 2026
Merged

Add per-request timeout override for long-running script executions#21
Niaobu merged 6 commits intomainfrom
claude/unityctl-build-command-afaoA

Conversation

@Niaobu
Copy link
Contributor

@Niaobu Niaobu commented Feb 19, 2026

Summary

  • Add Timeout field to RpcRequest so callers can override the default 30s timeout per-request
  • Bridge resolves timeout as: request-level > per-command config > default
  • CLI BridgeClient forwards 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
  • Add --timeout / -t flag to script eval and script execute CLI commands

Enables long-running operations like player builds via script eval:

unityctl script eval -t 300 -u UnityEditor '
var report = BuildPipeline.BuildPlayer(options);
return report.summary.result.ToString();
'

Test plan

  • 4 integration tests in RequestTimeoutTests.cs (override extends timeout, default still applies, errors propagate, override still times out)
  • Full test suite passes (157 tests)
  • Manual end-to-end: clean player build (44s) succeeds with -t 300, times out without it
  • --timeout works on both script eval and script execute

claude and others added 5 commits February 19, 2026 16:15
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.
@Niaobu Niaobu self-assigned this Feb 19, 2026
…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.
@Niaobu Niaobu marked this pull request as ready for review February 19, 2026 19:12
@Niaobu Niaobu merged commit 7c6fd71 into main Feb 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants