Move Guardian reviewer lifecycle into the extension (#45537)

## Why

Guardian reviews must stop when their parent shuts down or their history is reset. Shutdown must also finish reviewer cleanup before closing the parent's persistent history, including when a review is waiting to retry after a rate limit.

## What changed

- Let the Guardian extension own reviewer startup, prewarming, and shutdown through `ThreadManager`, tracking and joining outstanding work during teardown.
- Cancel reviews on history reset or parent shutdown and reject decisions returned after cancellation, including cached extension decisions.
- Keep background prewarm previews from overwriting the active turn's model metadata.

## Testing

Extend regression coverage to verify reviewer cleanup after parent shutdown, prompt shutdown during a 60-second Guardian retry with the network request denied, and preservation of active model review requirements during prewarming.

GitOrigin-RevId: 05efc369b9a1642a10365eac8a09da77f3f6e28c
This commit is contained in:
jif authored and copyberry committed 2026-09-14 22:58:51 +00:00
1 parent 12b0164a48
commit 18d7ace221
31 files changed
+495 -308

No files matched your search

+1
View File
@@ -3596,6 +3596,7 @@ dependencies = [
"codex-extension-api",
"codex-features",
"codex-guardian-context",
"codex-guardian-reviewer",
"codex-history",
"codex-http-client",
"codex-login",