You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two helpers solve the same root problem (the persisted --settingsenv block clobbering CCS's runtime routing env) with opposite strategies, and duplicate the temp-dir(0700)/file(0600)/idempotent-cleanup machinery:
createOpenAICompatLaunchSettings (utils/openai-compat-launch-settings.ts): strips routing keys so process env wins by absence. Used by settings-flow.ts and delegation/headless-executor.ts (openai-compat profiles).
Strip and overlay diverge when a key is present in the persisted settings env but absent from process env: strip removes it, overlay keeps it. settings-flow.ts deletes ANTHROPIC_API_KEY from process env and relies on strip to drop it from the temp settings; replacing strip with overlay there would leave a stale key and bypass the proxy auth. Unifying safely needs an explicit "force-absent" key-list parameter on the overlay helper, or restructured callers that pass a fully merged env with deletions represented explicitly.
Scope
Design one canonical helper with an explicit strip-list, migrate all three call sites, and regression-test the openai-compat, settings-flow, and cliproxy paths together. Deferred from the #1606 follow-up because it carries an auth-bypass regression risk and warrants a deliberate, separately reviewed change.
Summary
Two helpers solve the same root problem (the persisted
--settingsenvblock clobbering CCS's runtime routing env) with opposite strategies, and duplicate the temp-dir(0700)/file(0600)/idempotent-cleanup machinery:createOpenAICompatLaunchSettings(utils/openai-compat-launch-settings.ts): strips routing keys so process env wins by absence. Used bysettings-flow.tsanddelegation/headless-executor.ts(openai-compat profiles).prepareLaunchSettings(cliproxy/executor/launch-settings.ts, added in fix(codex): keep proxy chain authoritative over --settings env #1606): overlays resolved routing values so settings wins by overwrite. Used by the cliproxy interactive launcher.Why not a trivial merge
Strip and overlay diverge when a key is present in the persisted settings
envbut absent from process env: strip removes it, overlay keeps it.settings-flow.tsdeletesANTHROPIC_API_KEYfrom process env and relies on strip to drop it from the temp settings; replacing strip with overlay there would leave a stale key and bypass the proxy auth. Unifying safely needs an explicit "force-absent" key-list parameter on the overlay helper, or restructured callers that pass a fully merged env with deletions represented explicitly.Scope
Design one canonical helper with an explicit strip-list, migrate all three call sites, and regression-test the openai-compat, settings-flow, and cliproxy paths together. Deferred from the #1606 follow-up because it carries an auth-bypass regression risk and warrants a deliberate, separately reviewed change.