Repository navigation
fix(env): each configuration variable once, on a core that counts them once - #164
Open
antoinetoussaint-byte wants to merge 1 commit into
Open
antoinetoussaint-byte wants to merge 1 commit into
antoinetoussaint-byte wants to merge 1 commit into
Conversation
…m once CreateRunnerEnvironment put the service's full environment on the runner environment and Start handed the same set to the process again, so a native process received every configuration variable twice. Cores before v0.19.12 counted both copies against the 512 KiB process-environment limit, which refused runtime/worker at 1,012,847 bytes. Start alone now delivers the set. Core moves from v0.19.5 to the pin codefly CLI v0.1.233 uses (v0.19.18-0.20261029150419-9d2348c460ae), which contains 0772bc0da6 (count the effective environment). Closes #162 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Closes #162
What was wrong
CreateRunnerEnvironmentput the service's full environment (EnvironmentVariables.All()) on the runner environment, andStarthanded the same set to the process again. A native process receives the runner environment's entries plus its own, so every configuration variable went in twice. Core before v0.19.12 counted both copies against the 512 KiB process-environment limit. Local QA #3 (2026-10-31) hit this:runtime/workeron go agent 0.0.74 was refused at 1,012,847 bytes.Change
pkg/runtime/runtime.go: the service environment is no longer added to the runner environment.Startdelivers the complete set. That set includes everything Init's copy had, because the manager only adds entries after Init. Test and Lint already pass their environment explicitly.go.mod: corev0.19.5→v0.19.18-0.20261029150419-9d2348c460ae, the pin codefly CLI v0.1.233 uses. It contains 0772bc0da6 ("count effective environment before carrier delivery").TestStartedProcessReceivesEachConfigurationVariableOnce(root package): runs a real Load and a native Init with a workspace configuration, and no pre-bound runner, so Init creates the runner the way production does. It checks that Start's set has each key once, and that a process spawned from the runner environment inherits noCODEFLY__variable. With the old line put back it fails: the runner environment carriesCODEFLY__WORKSPACE_CONFIGURATION__ROBIN__CHAT,CODEFLY__MODULE, and the other identity keys.Same defect and same fix as codefly-dev/service-go-grpc#220 (released 0.1.72).
Classification
Fix, at the owner: this repo creates the runner environment and starts the process. Reused: core's
EnvironmentVariableManager, the runner seams, and core's effective-environment count. Nothing new added.Verified / not verified
go test -count=1 ./...,go vet ./...,go mod tidy -diffandCGO_ENABLED=1 go build .all pass locally.TestPackageRealCGO(SERVICE_GO_PACKAGE_TESTS=required), the manifest guard locally, and a composedcodefly runofruntime/workeron the new agent.go build,go mod tidy, goimports) run in the runner environment and no longer see service configuration. None of them read it.gofmt -lflagspkg/code/callgraph.go(comment alignment) on main.🤖 Generated with Claude Code