Repository navigation
fix(runtime-env): apply saved shared and project variables at every agent-runtime start (lr-3c8732) - #432
Merged
Conversation
…om the runtime environment (lr-3c8732) A real server, real WebSocket client, project context, SDK bridge and Claude adapter, with the Agent SDK stood in. On this base the variables are absent from the environment the Claude Code subprocess gets, and the Settings save is answered Not supported because the server never hands the env handlers to a project. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ted-variable list (lr-3c8732) One builder lays the shared and project Settings texts over a runtime's own environment and always returns the complete environment. One module lists the variables Settings may not set, by class, refused at save time and dropped at build time. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…gent-runtime start (lr-3c8732) Settings variables were stored and shown but never reached a runtime, and the server never handed the environment handlers to a project, so saving was answered Not supported. server.js now forwards them (and three other daemon callbacks the same way: auto-continue, tokens-per-MB headroom, restart for build update). Claude in process and in an OS user's worker, the Codex app-server, title generation and warmups take their environment from the builder. Saved changes restart idle runtimes; a running turn is never killed. The Settings pages now show the server's answer instead of an optimistic Saved. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d which are protected (lr-3c8732) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
BOBBIE — blocking (1 finding(s), 1 dropped)
Dropped candidates (1):
|
|
PEACHES — blocking (4 finding(s))
|
…a failed close reused, and one Codex server serving two environments (lr-3c8732) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…sions and never reuse a runtime that failed to close (lr-3c8732) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…never runs on another environment's server (lr-3c8732) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ement of a runtime that cannot close, and per-environment Codex servers (lr-3c8732) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
clagentic-builder
Bot
force-pushed
the
feat/lr-3c8732-runtime-env-builder
branch
from
October 11, 2026 04:32
e121684 to
c1ccabc
Compare
…m cannot clobber its replacement (lr-3c8732) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…he idle reaper and test the owner-change envrc removal (lr-3c8732) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
BOBBIE — clean (0 finding(s)) |
|
PEACHES — blocking (7 finding(s), 2 dropped)
Dropped candidates (2):
|
…gs change (lr-3c8732) A save now applies to runtimes started after it; a running or idle-attached runtime is never ended for it. Removes applyRuntimeEnvChange, the runtime signature, the scheduled retire, endIdleQuery/detachUnendableRuntime, the query-token gating (the base stream teardown is restored; the replacement-query guard stays), the daemon's refreshRuntimeEnv and the settings onChanged hook. The bridge now always sends runtimeEnv on a YOKE call (null for none) and fills the shared Codex model list from the no-session environment only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e and resolve one instance for every operation (lr-3c8732) Models, default model, threads, ref count and init now live on the instance; the adapter-level model cache, last-used and any-started fallbacks are gone. init, queries, model lists, titles, fork and rollback take one lookup that requires runtimeEnv (null = daemon environment). A thread operation runs on the live instance that holds the thread, else starts the instance for the caller's environment, else throws. A rewind rolls the Codex thread back before trimming local history and fails without trimming when it cannot. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…them when built; test callbacks by behaviour (lr-3c8732) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
BOBBIE — clean (0 finding(s), 1 dropped) Dropped candidates (1):
|
|
PEACHES — blocking (4 finding(s), 1 dropped)
Dropped candidates (1):
|
…nce, drop the thread-holder lookup (lr-3c8732) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… instance only (lr-3c8732) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
PEACHES — clean (0 finding(s), 3 dropped) Dropped candidates (3):
|
|
BOBBIE — clean (0 finding(s)) |
Contributor
|
Merged via clagentic-loadout v0.2.0
|
Contributor
|
This issue has been resolved in version 1.10.0-beta.1. To update, run: |
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.
TASK: lr-3c8732
What
Settings environment variables (shared, and per project) reach every agent-runtime start. One builder (lib/runtime-env.js) lays them over the environment of the runtime and always returns the COMPLETE environment (the Claude Agent SDK options.env replaces the subprocess environment). Protected variables (lib/runtime-env-keys.js, one list, by class) are refused at save with a message naming the variable and line, and dropped at build with one warning per variable and layer (names only, never values). NUL and carriage return in a name or value are refused at save and dropped at build.
Rulings in this PR
Proof after R13, git grep -n -E "runOnThread|.threads\b|threads: new Set|onThread|inst.threads" -- lib docs test -> 0 hits (exit 1): no code path selects an instance by thread id.
class sweep: git grep -n -E ".(init|supportedModels|createQuery|generateTitle|forkSession|rollbackThread)(" -- lib: 11 call sites can reach the Codex adapter and each passes runtimeEnv (null or overlay).
Demonstrated failure (R14)
Each changed test file was run, with the test files of this head, against lib/ of the head where its defect existed (lib/ taken from a scratch clone checked out at that sha under the spawn scratch directory, never the shared tree). Failing test names per file:
Against e121684 (R1/R2/R5 and the earlier Codex shape):
Against 199fcc5 (R10/R11/R12):
Against ec8c5ff (R13):
Caller shapes (CREW_SOP section 6)
No hook, guard, gate or test runner of the crew changes. Product-side shapes, each with a test through the real code: Claude in process and worker; Codex app-server (per-fingerprint instances, idle reclaim, per-instance models and default, fork/rollback by the caller env, runtimeEnv null); title generation; warmups; single-user; multi-user without os-users; worktree sessions; project with no envrc; shared env empty; protected key already saved; settings saved while a runtime is attached vs session started after; project owner change. Pending post-merge real run: a real claude subprocess (single-user and os-users) and a real codex app-server printing a Settings variable.
Tests
npm test at the pushed head. Failing-test-ID set = [lr-29f9 (5): ceiling - query at MAX_CONCURRENT is rejected with error+done immediately; lr-2d91 (4): getMemoryStats returns activeLiveCount and maxConcurrentSessions] (the two known local env-inheritance failures, lr-3c00dd; unrelated). test-gate exits 4 (not a pytest suite).
Followups
🤖 Generated with Claude Code