Isolate core tests from shell and rollout persistence (#33858)

## Why

The shared core test harness does not need to spawn a login shell for every
test, and approval scenarios exercise tool behavior rather than rollout
persistence.

## What changed

- Disable `ShellSnapshot` by default in `test_codex()`; snapshot-specific tests
  can continue to opt in explicitly.
- Give each approval scenario a named in-memory thread store so it does not use
  durable rollout storage.

GitOrigin-RevId: 787670857aa4f77d5fc442ec1e0bfe6d22314f63
This commit is contained in:
jif
2026-07-17 15:58:05 +00:00
committed by copyberry
parent b03545b5b8
commit 41ad08c1a6
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -1260,6 +1260,11 @@ pub fn test_codex() -> TestCodexBuilder {
.features
.disable(Feature::Apps)
.expect("test config should allow Apps override");
// Snapshot tests opt in explicitly; avoid spawning login shells for every test.
config
.features
.disable(Feature::ShellSnapshot)
.expect("test config should allow ShellSnapshot override");
})],
auth: CodexAuth::from_api_key("dummy"),
pre_build_hooks: vec![],
+6
View File
@@ -5,6 +5,7 @@ use anyhow::Result;
use codex_config::types::ApprovalsReviewer;
use codex_core::CodexThread;
use codex_core::config::Constrained;
use codex_core::config::ThreadStoreConfig;
use codex_core::sandboxing::SandboxPermissions;
use codex_features::Feature;
use codex_protocol::approvals::NetworkApprovalProtocol;
@@ -1846,8 +1847,13 @@ async fn run_scenario(scenario: &ScenarioSpec) -> Result<()> {
let model_override = scenario.model_override;
let model = model_override.unwrap_or("gpt-5.4");
let policy_src = scenario.action.policy_src();
let thread_store_id = format!("approval-scenario-{}", scenario.name);
let mut builder = test_codex().with_model(model).with_config(move |config| {
// These scenarios assert tool behavior, not rollout persistence.
config.experimental_thread_store = ThreadStoreConfig::InMemory {
id: thread_store_id,
};
config.permissions.approval_policy = Constrained::allow_any(approval_policy);
config
.set_legacy_sandbox_policy(sandbox_policy.clone())