Skip to content

hookd: 馃悰 Give package-install's tool-env download its own budget - #312

Merged
yasyf merged 1 commit into
mainfrom
tool-env-budget
Oct 5, 2026
Merged

yasyf merged 1 commit into
mainfrom
tool-env-budget

Conversation

@yasyf

@yasyf yasyf commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Stacked on #311 (base: installer-narrate).

Context

On 2026-10-04, the 20:42 PDT background update fetched 12.87.6 into Homebrew's Cellar but left
the host on 12.60.0. At 20:45:46, uv tool install capt-hook==12.87.6 failed with
signal: killed while downloading the 89 MiB claude-agent-sdk wheel. Tool-environment setup
shared package-install's single 3-minute context with deployment. Two later attempts reported
error: Failed and Request failed after 3 retries. The plugin then advanced ahead of the host,
triggering the version-skew lockout addressed at the bottom of this stack.

Summary

  • internal/hookd/command.go introduces packageToolEnvTimeout and installPackage:
    resolve the tool environment under a 15-minute budget, then start the existing 3-minute
    lifecycle budget.
  • internal/hookd/manager.go provides installProductToolEnv; Darwin and Linux deployment
    paths no longer resolve the environment inside their lifecycle context.
  • Downloads leave the running host untouched. Quiesce, supersede, activation, and the broker
    ping retain their 3-minute bound, so the disruption window does not grow. No retries are added.
  • The helper-install message states up to 15 minutes for the tool environment, followed by
    up to 3 minutes to restart the host.

Testing

Verified on the owner's machine, 2026-10-04:

  • TestPackageInstallStartsTheLifecycleBudgetAfterASlowToolEnv passes with separate budgets
    and fails when tool-environment setup returns to the 3-minute lifecycle budget.
  • go test ./internal/hookd.
  • go vet on Darwin and with GOOS=linux.

@yasyf
yasyf force-pushed the installer-narrate branch from ce6c830 to cdaef58 Compare October 5, 2026 06:32
@yasyf
yasyf force-pushed the installer-narrate branch from cdaef58 to 37a9f15 Compare October 5, 2026 06:53
@yasyf
yasyf changed the base branch from installer-narrate to main October 5, 2026 07:10
package-install resolved the capt-hook tool env under the same 3-minute
context as the rest of the install, so on a slow link the 89 MiB
claude-agent-sdk wheel outlasted it and the context SIGKILLed `uv tool
install`, leaving the host on its previous build. The tool env now runs
first under its own 15-minute deadline, and the 3-minute lifecycle budget
starts only once it is in place, still bounding quiesce, supersede,
activation, and the broker ping.
@yasyf
yasyf merged commit 3047961 into main Oct 5, 2026
23 checks 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.

1 participant