fix(infra): temp IdeA géré alloué avant le convention file, exposé via IDEA_MANAGED_TMP et instruction explicite privilégiant le temp géré à /tmp — #200
This commit is contained in:
@ -4732,7 +4732,7 @@ async fn launch_pty_allocates_managed_tmp_env_and_sandbox_from_same_path() {
|
||||
ContextInjection::convention_file("CLAUDE.md").unwrap(),
|
||||
)
|
||||
.with_projector(ProjectorKey::Claude);
|
||||
let (launch, agent, _fs, pty, _sessions) = launch_with_projection(
|
||||
let (launch, agent, fs, pty, _sessions) = launch_with_projection(
|
||||
profile,
|
||||
Some(ContextInjectionPlan::File {
|
||||
target: "CLAUDE.md".to_owned(),
|
||||
@ -4752,6 +4752,21 @@ async fn launch_pty_allocates_managed_tmp_env_and_sandbox_from_same_path() {
|
||||
assert_eq!(env.get("TMPDIR"), Some(&tmp));
|
||||
assert_eq!(env.get("TMP"), Some(&tmp));
|
||||
assert_eq!(env.get("TEMP"), Some(&tmp));
|
||||
assert_eq!(env.get("IDEA_MANAGED_TMP"), Some(&tmp));
|
||||
let writes = fs.context_writes();
|
||||
let convention = String::from_utf8(writes[0].1.clone()).unwrap();
|
||||
assert!(
|
||||
convention.contains("**Temporaire IdeA géré**"),
|
||||
"convention file must explicitly surface the managed temp directory: {convention}"
|
||||
);
|
||||
assert!(
|
||||
convention.contains(&tmp),
|
||||
"convention file must carry the concrete managed temp path: {convention}"
|
||||
);
|
||||
assert!(
|
||||
convention.contains("privilégie-le à `/tmp`"),
|
||||
"convention file must steer agents away from literal /tmp usage: {convention}"
|
||||
);
|
||||
let sandbox = spawn.sandbox.expect("sandbox plan");
|
||||
assert!(sandbox_has_rw_root(&sandbox, &tmp));
|
||||
let _ = std::fs::remove_dir_all(&root);
|
||||
@ -4796,6 +4811,7 @@ async fn launch_structured_non_codex_uses_managed_tmp_for_env_without_os_sandbox
|
||||
assert_eq!(env.get("TMPDIR"), Some(&tmp));
|
||||
assert_eq!(env.get("TMP"), Some(&tmp));
|
||||
assert_eq!(env.get("TEMP"), Some(&tmp));
|
||||
assert_eq!(env.get("IDEA_MANAGED_TMP"), Some(&tmp));
|
||||
assert_eq!(factory.policies(), vec![None]);
|
||||
assert_eq!(
|
||||
factory.sandboxes(),
|
||||
@ -4841,6 +4857,7 @@ async fn launch_structured_codex_uses_managed_tmp_for_env_and_writable_roots_wit
|
||||
assert_eq!(env.get("TMPDIR"), Some(&tmp));
|
||||
assert_eq!(env.get("TMP"), Some(&tmp));
|
||||
assert_eq!(env.get("TEMP"), Some(&tmp));
|
||||
assert_eq!(env.get("IDEA_MANAGED_TMP"), Some(&tmp));
|
||||
let Some(domain::ports::StructuredProviderLaunchPolicy::Codex { writable_roots, .. }) =
|
||||
factory.policies().into_iter().next().unwrap()
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user