Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

ci(process-statics): record the idle guard's task-locals; drop a test static

killbillb9dd7f0fad6d
diff --git a/crates/openhuman-core/src/web_chat/turn_close.rs b/crates/openhuman-core/src/web_chat/turn_close.rs
index 7ccd39d7d9..3c8d211f02 100644
--- a/crates/openhuman-core/src/web_chat/turn_close.rs
+++ b/crates/openhuman-core/src/web_chat/turn_close.rs
@@ -239,18 +239,14 @@ fn close_request(turn: &StoppedTurn<'_>, evidence: &Evidence) -> ModelRequest {
)
}
-/// Tests run offline: the closing model call is skipped and the plain reply
-/// is used.
-#[cfg(test)]
-static PLAIN_ONLY: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(true);
-
async fn model_reply(
config: &crate::config::Config,
turn: &StoppedTurn<'_>,
evidence: &Evidence,
) -> Option<String> {
- #[cfg(test)]
- if PLAIN_ONLY.load(std::sync::atomic::Ordering::SeqCst) {
+ // Tests run offline: the closing model call is skipped and the plain
+ // reply is used.
+ if cfg!(test) {
return None;
}
let request_id = turn.request_id;
diff --git a/scripts/ci/process-statics.json b/scripts/ci/process-statics.json
index d52178b8e2..f5ba440edb 100644
--- a/scripts/ci/process-statics.json
+++ b/scripts/ci/process-statics.json
@@ -78,5 +78,35 @@
"category": "A",
"reason": "Registry ids whose serving source was already logged, so each is logged once; holds static ids only.",
"verification": "modules/ops_tests.rs: status_reports_the_source_that_serves_a_module"
+ },
+ {
+ "file": "crates/openhuman-core/src/web_chat/turn_activity.rs",
+ "scope": "",
+ "name": "CURRENT_TURN_ACTIVITY",
+ "type": "TurnActivity",
+ "count": 1,
+ "category": "B",
+ "reason": "A tokio task_local, not a process global: `with_turn_activity` scopes one value per web turn on that turn's own task, and `run_chat_task` reads it to tap the same turn's progress. No other task or turn can observe it; the value holds only that turn's activity, its own resolved config and locale.",
+ "verification": "web_chat/turn_activity_tests.rs: task_local_scope_is_visible_inside_only"
+ },
+ {
+ "file": "crates/openhuman-core/src/sandbox/shell_progress.rs",
+ "scope": "",
+ "name": "CURRENT_METER",
+ "type": "ShellOutputMeter",
+ "count": 1,
+ "category": "B",
+ "reason": "A tokio task_local, not a process global: `with_shell_progress` scopes one meter per shell call on that call's task, and `shell_exec::run` reads it before spawning that call's worker. It holds only that call's output byte count and last line; no other call or turn can observe it.",
+ "verification": "sandbox/shell_progress_tests.rs: without_a_context_no_meter_is_scoped, a_long_call_reports_its_output_as_it_runs"
+ },
+ {
+ "file": "crates/openhuman-core/src/web_chat/ops/test_hooks.rs",
+ "scope": "",
+ "name": "TEST_PARK_AFTER_RUN",
+ "type": "std::sync::atomic::AtomicBool",
+ "count": 1,
+ "category": "A",
+ "reason": "A debug/test-only hook flag (`cfg(any(test, debug_assertions))`) that parks `run_chat_task` after its run so the idle guard can be exercised end to end; it holds no tenant data and is off unless a test sets it.",
+ "verification": "tests/agent_harness_e2e.rs: idle_guard_local::stalled_turn_is_stopped_by_the_idle_guard_and_closed_with_a_summary"
}
]