Skip to content

feat(plugin): make the host->plugin invoke timeout configurable - #611

Closed
atrawog wants to merge 1 commit into
mainfrom
feat/configurable-plugin-invoke-timeout
Closed

atrawog wants to merge 1 commit into
mainfrom
feat/configurable-plugin-invoke-timeout

Conversation

@atrawog

@atrawog atrawog commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

defaultPluginInvokeTimeout was a hardcoded 10 minutes. It correctly bounds a HUNG host→plugin call (the deploy-del deadlock it was added for), but some legitimate calls are long-running: the R10 [update] step's deploy:vm op=rebuild runs a full unattended OS reinstall, which exceeds 10m and was cut off mid-rebuild.

Make it configurable via CHARLY_PLUGIN_INVOKE_TIMEOUT (a Go duration string, e.g. 30m):

  • unset → 10m default (unchanged);
  • set + parseable + positive → that value;
  • unparseable / non-positive → warns and keeps the 10m default.

The var stays a package var so tests can still override it to a short value.

How tested

$ gofmt -l charly/provider_invoke.go     # (empty)
$ cd charly && go build ./...            # ok
$ go test -run 'TestInvokeTyped_FailsFastOnHungPlugin|TestPluginInvokeTimeoutFromEnv' .
ok  github.com/opencharly/charly/charly

TestPluginInvokeTimeoutFromEnv pins the precedence table (unset/30m/1h/-5m/garbage) and was verified to FAIL when the env read is removed:

--- FAIL: TestPluginInvokeTimeoutFromEnv
    pluginInvokeTimeoutFromEnv() with "30m" = 10m0s, want 30m0s
    pluginInvokeTimeoutFromEnv() with "1h" = 10m0s, want 1h0m0s

The existing TestInvokeTyped_FailsFastOnHungPlugin still passes (the hung-plugin guard is intact).

Live context: check-omarchy-iso-vm reached [check-live] PASS 64/64 then hit [update] FAIL after 13m8.492s with rpc error: code = DeadlineExceeded — the exact bound this makes raisable.

Rulebook compliance

  • R1 — the [update] timeout was root-caused to the hardcoded invoke bound, not the reinstall.
  • R4 — no sleep/retry; the operator raises the bound explicitly.
  • R7 — discriminating coverage for the env precedence; the hung-plugin guard retained.
  • R10 — go build + go test on the final tree.

Change classification

  • Change class: core config (env-overridable timeout).
  • Verification gate: gofmt / go build / go test.
  • Attribution tier: analysed on a live system — the timeout was observed on the live bed; the override is unit-proven. The full charly R10 bed gate is downstream.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

The 10m defaultPluginInvokeTimeout bounds a HUNG plugin, but some legitimate
host->plugin calls are long-running: the R10 [update] step's deploy:vm op=rebuild
runs a full unattended OS reinstall, which exceeds 10m and was cut off
mid-rebuild (context deadline exceeded) even though check-live had passed 64/64.
CHARLY_PLUGIN_INVOKE_TIMEOUT (a Go duration, e.g. 30m) raises it without a
rebuild; a missing/unparseable/non-positive value keeps the 10m default.
TestPluginInvokeTimeoutFromEnv pins the precedence and was verified to fail
without the env read.
@github-actions

Copy link
Copy Markdown
Contributor

Review — BLOCK

Head SHA: dbd3d4eca455 (branch not reported by get_pr_meta; base e0211c34aa81)

Change class: core runtime/config change — Go code in charly/ (provider_invoke.go + new unit test), no docs-only exemption available.

Security screen: PASS — no secrets/egress/eval, no guardrail or validator-spec edits, no new deps; the only new input is an operator-set duration env var, parsed and bounded to the 10m default. (No T1–T4 finding.)

Blocks

  1. A2 — wrong gate for the change class (no bed run). The body's "How tested" is only gofmt -l, go build ./..., go test -run ... against charly/provider_invoke.go. A runtime/code change in core requires a FRESH-rebuild bed run with pasted output on a target explicitly disposable: true; a bare go test/go build is not the change-class gate. Required: a fresh charly update/rebuild (+ the R9 assertion that the deployed binary was rebuilt and charly version matches source, zero warnings), exercising the CHANGED path — i.e. an [update]-step / deploy:vm op=rebuild run with CHARLY_PLUGIN_INVOKE_TIMEOUT raised — with pasted output for each changed piece.

  2. A1/B12 — the body itself defers the gate. "The full charly R10 bed gate is downstream" is a forbidden future-work promise ("will test later"), and the rulebook-compliance line "R10 — go build + go test on the final tree" shrinks R10 to a build+test run. R10 names the disposable fresh-rebuild/bed coverage from the change-class matrix. The body also names no disposable: true target, gives no fresh-rebuild confirmation, and never states whether the changed env-resolution path executed live anywhere.

  3. A3 — inflated attribution tier. analysed on a live system is supported only by a PRE-change observation: check-omarchy-iso-vm PASS 64/64 then [update] FAIL after 13m8.492s / DeadlineExceeded on the old hardcoded 10m bound. The new pluginInvokeTimeoutFromEnv path (the code under review) ran only in a unit test. Either back the tier with a post-change live run of the changed path, or re-state/withhold the tier.

  4. A1 — rulebook-compliance section is incomplete. Only R1/R4/R7/R10 are answered. Every applicable rule needs a one-line HOW or N/A — <reason>; in particular R3 (the new duration-parsing helper must be shown not to duplicate an existing env-duration parse in the tree, per the no-duplication rule), and R2/R5/R6/R8/R9 for the deployment path the [update] step touches.

Tool-limited note (not a block): the diff adds no import lines while the new code uses os and fmt; since I cannot open the file, confirm those are already imported — if not, the pasted go build ./... success is unreproducible.

Verdict: BLOCK


opencode/deepseek-v4.1-flash — action-review.

View action run

@github-actions

Copy link
Copy Markdown
Contributor

[step: review]

Review — BLOCK

Head SHA: dbd3d4eca455 (branch not reported by get_pr_meta; base e0211c34aa81)

Change class: core runtime/config change — Go code in charly/ (provider_invoke.go + new unit test), no docs-only exemption available.

Security screen: PASS — no secrets/egress/eval, no guardrail or validator-spec edits, no new deps; the only new input is an operator-set duration env var, parsed and bounded to the 10m default. (No T1–T4 finding.)

Blocks

  1. A2 — wrong gate for the change class (no bed run). The body's "How tested" is only gofmt -l, go build ./..., go test -run ... against charly/provider_invoke.go. A runtime/code change in core requires a FRESH-rebuild bed run with pasted output on a target explicitly disposable: true; a bare go test/go build is not the change-class gate. Required: a fresh charly update/rebuild (+ the R9 assertion that the deployed binary was rebuilt and charly version matches source, zero warnings), exercising the CHANGED path — i.e. an [update]-step / deploy:vm op=rebuild run with CHARLY_PLUGIN_INVOKE_TIMEOUT raised — with pasted output for each changed piece.

  2. A1/B12 — the body itself defers the gate. "The full charly R10 bed gate is downstream" is a forbidden future-work promise ("will test later"), and the rulebook-compliance line "R10 — go build + go test on the final tree" shrinks R10 to a build+test run. R10 names the disposable fresh-rebuild/bed coverage from the change-class matrix. The body also names no disposable: true target, gives no fresh-rebuild confirmation, and never states whether the changed env-resolution path executed live anywhere.

  3. A3 — inflated attribution tier. analysed on a live system is supported only by a PRE-change observation: check-omarchy-iso-vm PASS 64/64 then [update] FAIL after 13m8.492s / DeadlineExceeded on the old hardcoded 10m bound. The new pluginInvokeTimeoutFromEnv path (the code under review) ran only in a unit test. Either back the tier with a post-change live run of the changed path, or re-state/withhold the tier.

  4. A1 — rulebook-compliance section is incomplete. Only R1/R4/R7/R10 are answered. Every applicable rule needs a one-line HOW or N/A — <reason>; in particular R3 (the new duration-parsing helper must be shown not to duplicate an existing env-duration parse in the tree, per the no-duplication rule), and R2/R5/R6/R8/R9 for the deployment path the [update] step touches.

Tool-limited note (not a block): the diff adds no import lines while the new code uses os and fmt; since I cannot open the file, confirm those are already imported — if not, the pasted go build ./... success is unreproducible.

Verdict: BLOCK


opencode/deepseek-v4.1-flash — action-review.

View action run

@atrawog

atrawog commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Withdrawn: this tunes the arbitrary 10m number instead of fixing the root cause. The bound is a hung-plugin guard applied as a TOTAL-duration cap, so it kills a legitimately-progressing ~13min unattended OS install (check-omarchy-iso-vm's R10 [update] gate). Root fix = an idle/no-progress bound (replacing the total cap) lands separately.

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