Repository navigation
CONTRACT: fix(backends): use the host app exec wrapper - #2397
Draft
schlessera wants to merge 5 commits into
Draft
schlessera wants to merge 5 commits into
schlessera wants to merge 5 commits into
Conversation
Carry optional host exec through startup and per-turn probes, backend construction, Claude SDK spawning and Pi worker-local tools. Preserve explicit-empty and omitted-host compatibility. Add keyless runtime and propagation mutation coverage; include the additive contract, minor changeset, API report and moved citations.
…ions Keep explicitly supplied host configuration copied per backend, including empty configuration. Preserve omission through standalone construction and resolve the host fallback for each Pi worker turn. Add intended-red controls for ambient changes after construction and correct the additive contract and changeset wording.
This was referenced Oct 18, 2026
This branch has not been deployed
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.
Refs #1429
What changed
Each app passes its resolved exec wrapper through startup probes, backend construction, Claude per-turn probes and SDK workers, and Pi grep/bash tools including worker-local construction. Host A/C override ambient B. An explicit empty configuration disables the optional wrapper. Omitted standalone inputs retain the previous late ambient fallback, including an environment change after factory construction; Pi carries the current host fallback into each worker turn.
Why this shape
The existing backend context and factory options carry the host configuration, as required by #1429 and #1343. Explicit configurations are copied per backend; omission stays distinguishable from
{}. Validation, argv, permissions, credential selection and worker isolation retain their behavior. The additive contract, three optional public API fields, minor changeset and moved citations are included.Proof
Local tested head
f462a8f84bbe1d296a55c1f3f45e8d8475c6ab04; local tested base82a64a13a08c44f2daef425d1a9df2c10840ea8e. Fetched target main is now68e12f27eb249c9fe7262a498a0397c04bbda8f4: browser weights (#2379), viewer font-floor proof (#2368), native phase composition (#2384), and private-tmp placement proof (#2389) advance its proof inputs. That newer combined tree is unqualified here. Preserved implementationf7f3b3f1d390081ac54aa52dccb4389316d86ecc; #2361's app/worker/maintenance inputs were reviewed and integrated indb37ddcb6, and #2371's five native TCP fixture changes inf462a8f84.f7f3b3f1d/ base0d780605f: required Claude/Pi/server suites pass 4,362 tests / 28,452 assertions across 386 files, including app isolation and both provider-history guards. This receipt belongs to that original tree, not the final candidate.b4cf5234c: 87 focused tests / 328 assertions across six files pass actual app A/C, empty/omitted inputs, Claude probes/SDK argv, Pi grep/bash/worker init and decision citations. Explicit propagation mutation failsSDK_WORKER_HOST_ARGV; restored file passes 1 test / 22 assertions. Separate intended-red controls prove late ambient changes after construction:OMITTED_HOST_EXEC_REMAINS_LIVEandPI_WORKER_OMITTED_EXEC_REMAINS_LIVE.HOST_PROBE_A,HOST_WRAPPER_SELECTED,PI_WORKER_HOST_EXECandAPP_RUNTIME_PROBE_WRAPPER, in addition to the repeated SDK mutation.resolveExecConfig()in either backend; all ambient edges, host propagation, worker serialization and factory omission handling were reviewed.f7f3b3f1d. This contribution and both integrated base deltas leave its source families/pins unchanged; ci: native diagram qualification self-test rejects legitimate source drift #2365 is not an established blocker here.bun run check:pr --base origin/maincompleted exit 1 on the local tested head/base: lint/leakage, environment docs and changeset checks passed; fast invariants 730 pass / 36 files; import-graph feedback 3,378 pass / 2 fail / 25,774 assertions / 283 files. Both failures report native CLI exit 137: hygiene same-identity refresh and module-settings active-state HTTP 500. Tracked in P1 ci: diagnose native CLI exit 137 during hygiene and module-settings preflight #2396.f462a8f84: 25 pass / 135 assertions across both backends, including real captured native requests.Historical evidence remains distinct: earlier exit-137, quota/body-restoration and cancelled/incomplete suite receipts are preserved on #1429. Continuation preflights failed on owned cancelled-run artifacts inside the tree (moved intact outside; strict leakage passed) and unsafe fixture cleanup (corrected in
cd980abec). The subsequent preflight passed 730 fast invariants and real-browser scratch/viewer, share, tracker and turn-journal controls, then was deliberately stopped to correct the proven late-fallback regression. It remains incomplete. Local memory/pids/CPU cgroup limits were reported unavailable; passing native/rlimit tests do not qualify those controls.Checklist
Anything left open
Blocked by #2396
Diagnose and resolve the native CLI termination failures, reconcile the newer target proof inputs, pass required preflight and complete selected current-candidate hosted proof, inspect selected jobs/checkouts, then verify milestones, matching-head merge, main ancestry, issue closure and automatic main-push proof. No behavior criterion is intentionally deferred. Per-app mutable state remains owned by #1364. A pre-existing source-comment pointer, unchanged by this contribution, is tracked separately in nonblocking #2383.