Finding
aid/src/main.rs:92 reads DEVLAUNCH_AID_AGENT with the call osext exists to replace:
std::env::var(rewrite::AGENT_ENV_VAR).ok().as_deref(),
osext.rs:11-13 names the hazard: std::env::var(..).ok() reports a non-UTF-8 value as unset. So a DEVLAUNCH_AID_AGENT holding undecodable bytes silently selects the default agent instead of refusing with UnknownAgentInEnvironment — the refusal rewrite::default_agent (aid/src/rewrite.rs:244) exists to give.
This is the same class as the DEVLAUNCH_NO_TTY divergence fixed in b52f4fa, with a milder consequence: a wrong agent rather than an inverted opt-out. Filed rather than fixed alongside it because the fix is not local — aid depends on dl and not on devlaunch-core (deliberately: aid/src/main.rs:20-26), so the correct reader has to be re-exported one more level, and that is surface churn worth deciding on rather than smuggling into a bug fix.
Shape
Either re-export the reader through dl the way shell and python_repr already are (dl/src/lib.rs:44,51), or have rewrite take the already-decoded value and let dl do the reading. The second keeps aid's dependency story intact.
While there: osext is still pub(crate) apart from the one wrapper b52f4fa exposed. Every future binary-side environment read has the same trap set for it, and the general fix is to make osext binary surface — the tier clients, domain and flows already sit in.
Proving it
DEVLAUNCH_AID_AGENT=$'\xff' should refuse by name, not fall through to the default.
Finding
aid/src/main.rs:92readsDEVLAUNCH_AID_AGENTwith the callosextexists to replace:osext.rs:11-13names the hazard:std::env::var(..).ok()reports a non-UTF-8 value as unset. So aDEVLAUNCH_AID_AGENTholding undecodable bytes silently selects the default agent instead of refusing withUnknownAgentInEnvironment— the refusalrewrite::default_agent(aid/src/rewrite.rs:244) exists to give.This is the same class as the
DEVLAUNCH_NO_TTYdivergence fixed in b52f4fa, with a milder consequence: a wrong agent rather than an inverted opt-out. Filed rather than fixed alongside it because the fix is not local —aiddepends ondland not ondevlaunch-core(deliberately:aid/src/main.rs:20-26), so the correct reader has to be re-exported one more level, and that is surface churn worth deciding on rather than smuggling into a bug fix.Shape
Either re-export the reader through
dlthe wayshellandpython_repralready are (dl/src/lib.rs:44,51), or haverewritetake the already-decoded value and letdldo the reading. The second keepsaid's dependency story intact.While there:
osextis stillpub(crate)apart from the one wrapper b52f4fa exposed. Every future binary-side environment read has the same trap set for it, and the general fix is to makeosextbinary surface — the tierclients,domainandflowsalready sit in.Proving it
DEVLAUNCH_AID_AGENT=$'\xff'should refuse by name, not fall through to the default.