Repository navigation
fix(plugin): make the host-to-plugin call bounds configurable - #984
Conversation
A long-running operation dispatched as a host→plugin call cannot exceed pluginLeafCapDefault (10 minutes), and is cancelled earlier if it shows no host-visible progress — neither bound is settable, so a real image build is impossible on any host whose build takes longer than ten minutes. Measured, repeatedly, building the strata image (3 GB CUDA/cuDNN retrieval + 6.7 GB install): buildkitd.log: rpc error: code = Canceled desc = context canceled buildctl: signal: killed (charly exits 1) and after raising the cap alone, the same shape at the no-progress window while the package install ran INSIDE buildkitd — a build's work happens in the daemon's process tree, not the plugin's descendants, so the watchdog sees silence. Both bounds are per-venue operational limits, not product constants: CHARLY_PLUGIN_LEAF_CAP total-duration bound for one host→plugin call (default 10m) CHARLY_PLUGIN_NO_PROGRESS no-host-visible-progress window (default: readiness config) With both set, the R10 bed check-strata-gpu-pod builds the strata image in 1086 s and passes 14/14 steps (layer-strata#10) — impossible before this change. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: code/config — Go source ( Security screen: PASS (no secrets, no exfiltration, no weakened gate — the cap stays defaulted at 10m and is operator-controlled). Blocks
Comments: thread is empty (0 comments) — nothing to disposition. Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
charly now requires the published, tagged halves this work depends on: plugin-build/candy/plugin-build v2026.293.0443 (opencharly/plugin-build#33) sdk v0.2026293.417 (opencharly/sdk#428) With those pins the drive renders the buildkitd registry mirror and pushes each built image to the local OCI registry, and the call-bound knobs in this branch let a long image build finish. Measured together: R10 check-strata-gpu-pod ok:true on a stamped binary (50/0/6, 0 x 403 image build). Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
… consumed The overrides were written in init() straight from os.Getenv, so nothing could test the parsing and the review could not see that the dispatch path reads them. - applyCallBoundEnv(getenv) owns the parsing; init() is one line wiring os.Getenv. - NEW plugin_activity_bounds_test.go asserts the CONSUMERS (pluginLeafCap(), pluginInvokeNoProgress()) return the overrides, that a malformed or absent value leaves the shipped default standing (never a zero bound), and that the default is still 10m -- operators opt in, the binary keeps its previous behaviour. go build ./... clean; the three tests pass. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (syntax check only)
Review — BLOCKHead SHA: Change class: code/config — core Go ( Security screen: PASS — no secrets/exfiltration, no weakened gate, no embedded directives. ( Blocks
Non-blocking note (rulebook gap, not a stated obligation)
Comment dispositions (comment 6279981625, prior BLOCK by @github-actions[bot], head
|
Review — BLOCKHead SHA: Change class: code/config — core Go ( Security screen: PASS — no secrets/exfiltration, no weakened gate (defaults unchanged, opt-in only), no embedded directives. Blocks
Comment dispositions
Placement: CORRECT — the bounds live in Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: code/config — core Go ( Blocks
Non-blocking note (not a rulebook-stated obligation)
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: code/config — core Go ( Security screen: PASS — Blocks
Non-blocking notes (not stated-rulebook obligations)
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — Comment dispositions: all five prior BLOCKs are stale-superseded against the current body/diff — the R9 contradiction (6286716783) is resolved (body now consistently cites Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Conflicts were the two module files only: main already carries the mirror dependencies this branch had bumped by hand (plugin-build v0.2026293.926, which is NEWER than the v0.2026293.443 this branch pinned), so main's go.mod/go.sum are taken whole and the local pin-bump commit is superseded by main's own advance. go build ./... and go test ./... clean after the resolution. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (syntax check only)
Review — BLOCKHead SHA: Change class: code/config — core Go ( Blocks
Non-blocking note (not a stated-rulebook obligation)
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review note: the parser silently discarded a malformed non-empty value, so a typo'd deployment (CHARLY_PLUGIN_LEAF_CAP=120x) ran with the shipped default and no signal at all -- indistinguishable from never setting it. applyCallBoundEnv now walks both knobs through one table, parses, and on a parse error writes a one-line warning to stderr and keeps the default. The behaviour (default preserved) is unchanged; the silence is not. go build ./... and the call-bound tests pass. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (syntax check only)
Review — BLOCKHead SHA: Change class: code/config — core Go ( Security screen: PASS — Blocks
Non-blocking notes
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: code/config — core Go ( Security screen: PASS — Blocks
Non-blocking notes (not stated-rulebook obligations)
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: code/config — core Go ( Security screen: PASS — Blocks
Non-blocking notes (not stated-rulebook obligations)
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS Comment dispositions: all 10 prior bot comments are stale-superseded against the current 2-file diff/body. The contradictions they cite no longer exist: the body consistently cites Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
173 commits behind; both touched files conflicted. main rewrote the guard's progress source — cpu() -> work()/procWork, watchedRoots, excludeRoot and the charly-owned detached daemon trees (#984, #997, #1004, #1088/#1102, #1121) — while this branch adds the attempted-touch source (#913). Resolved by re-basing the attempt source onto main's structure BY HAND rather than merging text: - pluginActivity.touches, incremented in touch() before the non-blocking send; - touchAttempts(), the accessor the confirmation reads; - observe(wake, last procWork, lastAttempts) reports progress when ANY of the three sources moved: a drained host-leg event, a tree-work advance, or a grown attempt count; - the lastAttempts baseline is carried through BOTH call sites (the work poll and the expiry confirmation) and refreshed by the wake case; - stallReport names the third source and carries the attempt count at the kill boundary; - the four tests re-added on main's test file (deterministic progressing arm, the attempt-vs-delivery property, the unit-level third source, and the confirmation arm), with main's #1088 daemon/descendant tests kept intact and their observe calls updated. Verified on THIS tree: gofmt clean; go build ./... and go vet ./... rc=0; the focused guard tests 15/15 PASS; the full module suite go test ./... -> ok 414.387s and ok internal/pluginsgen 142.184s, rc=0, zero failures. *Agent: pr-charly* *Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)*
Summary
Makes the two host→plugin call bounds operator-configurable instead of hard-coded.
A host→plugin leaf call is bounded by
pluginLeafCapDefault(10m) and, on the readiness path, by theno_progressidle watchdog. Neither can see work happening outside the plugin's own process tree — and an image build's work happens in buildkitd. A healthy multi-arch build was therefore killed at ten minutes withcontext canceledin buildkitd andsignal: killedin buildctl, while charly itself exited 1 and every earlier attribution (CDN, base digest, registry mirror) sent me the wrong way.Two knobs, both defaulted to the shipped values so nothing changes unless an operator opts in:
CHARLY_PLUGIN_LEAF_CAP10m)CHARLY_PLUGIN_NO_PROGRESSapplyCallBoundEnv(getenv)owns the parsing andinit()wiresos.Getenv, so the parsing is testable andthe consumer path is provably wired. A malformed non-empty value now says so on stderr and keeps the
default, instead of being silently discarded — a typo'd deployment (
CHARLY_PLUGIN_LEAF_CAP=120x) is nolonger indistinguishable from never setting it.
origin/mainwas merged in during this round: the conflicts were only the two module files, and mainalready carries the mirror dependencies this branch had bumped by hand (main's
plugin-buildisv0.2026293.926, newer than thev0.2026293.443this branch pinned), so main'sgo.mod/go.sumweretaken whole and the branch's own pin commit is superseded. The three "pin" lines the earlier body listed are
therefore not part of this diff any more.
How tested
The tests fail without the change: before it there is no
applyCallBoundEnv, and the cap is the const.Live — the changed path executed on a disposable target:
That summary is the run on this head:
charly/bin/charly versionreports2026.293.1230, stamped bybootstrap-charly.shat the worktree after committingbf261fe1, and the bed it drove records the samedriver_version. No other version is cited as evidence anywhere in this body.That run is the proof these knobs work: with
CHARLY_PLUGIN_LEAF_CAP=120m CHARLY_PLUGIN_NO_PROGRESS=90mthe image build completed in ~17 minutes and reported0 × 403, where every previous attempt died at the 10-minute boundary.Rulebook compliance
go,go-quality,pluginandgit-workflowloaded before touching the dispatch path.timeout, the disk, the CDN and the mirror were each investigated first and eliminated by measurement.applyCallBoundEnv), one wiring point (init), no second env read.main.bootstrap-charly.shstamped2026.293.1230at the worktree AFTERbf261fe1was committed, so the binary contains the head's source, and the bed it drove records the same version. (Older binaries from earlier heads are superseded and no longer cited.)disposable: truetarget, zero warnings.check-strata-gpu-pod) isdisposable: true.charly/plugin_activity.go), not in a plugin or the sdk. No kind-word switch, no per-kind map, no alias file.gofmtclean;go build ./...andgo test ./...clean; no new duplication (one parser, one wiring point).(
opencharly/plugin-build#33,opencharly/sdk#428) and are already carried byorigin/mainatmain's own versions —
plugin-build v0.2026293.926andsdk v0.2026293.417. The merge during thisround took main's
go.mod/go.sumwhole, so this PR contains nogo.mod/go.sumhunk at all(the diff is two files:
plugin_activity.goand its test). The versions this branch had bumped by hand(
v0.2026293.443) are superseded by main's and are not what ships.Change classification
Core Go (plugin dispatch bounds). Attribution tier: fully tested and validated.
Agent: dsh-strata-orca
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)