mirror of
https://github.com/openai/codex.git
synced 2026-11-03 08:22:30 +00:00
Include auto-review rollout in feedback uploads (#20064)
## Summary - include the live auto-review trunk rollout when `/feedback` uploads logs - upload that attachment as `auto-review-rollout-<parent-thread-id>.jsonl` so it is distinguishable from the parent rollout - show the same auto-review attachment name in the TUI consent popup ## Scope - this only covers the live cached auto-review trunk for the current parent thread - it does not add durable historical parent->auto-review lookup - it does not add persisted rollout support for ephemeral parallel review forks ## UI <img width="599" height="185" alt="Screenshot 2026-04-28 at 1 17 18 PM" src="https://github.com/user-attachments/assets/6a0e79c2-5d21-4702-8a89-f765778bc9e9" /> ## Validation - `cargo test -p codex-core cached_guardian_subagent_exposes_its_rollout_path` - `cargo test -p codex-feedback` - `cargo test -p codex-app-server` - `cargo test -p codex-tui feedback_upload_consent_popup_snapshot` - `cargo test -p codex-tui feedback_good_result_consent_popup_includes_connectivity_diagnostics_filename` ## Known unrelated local failures - `cargo test -p codex-core` currently fails in the pre-existing proxy env snapshot test `tools::runtimes::tests::maybe_wrap_shell_lc_with_snapshot_keeps_user_proxy_env_when_proxy_inactive` - `cargo test -p codex-tui` currently hits pre-existing `status::*` snapshot drift unrelated to this change ## Follow-Up - persist parallel auto-review fork sessions so /feedback can include their rollout history too - attach each persisted fork as its own clearly named file, for example auto-review-rollout-<parent-thread-id>-fork <n>.jsonl, instead of merging multiple Guardian sessions into one attachment - keep the same live-session-only scope initially; durable historical parent -> auto-review lookup can remain a separate decision if we later need feedback from resumed sessions
This commit is contained in:
1 parent
05fd904572
commit
5cf0adba93
10 files changed
+115
-12
No files matched your search
@@ -369,6 +369,14 @@ impl CodexThread {
|
||||
self.rollout_path.clone()
|
||||
}
|
||||
|
||||
pub async fn guardian_trunk_rollout_path(&self) -> Option<PathBuf> {
|
||||
self.codex
|
||||
.session
|
||||
.guardian_review_session
|
||||
.trunk_rollout_path()
|
||||
.await
|
||||
}
|
||||
|
||||
pub fn state_db(&self) -> Option<StateDbHandle> {
|
||||
self.codex.state_db()
|
||||
}
|
||||
|
||||
@@ -259,6 +259,18 @@ impl Drop for EphemeralReviewCleanup {
|
||||
}
|
||||
|
||||
impl GuardianReviewSessionManager {
|
||||
pub(crate) async fn trunk_rollout_path(&self) -> Option<PathBuf> {
|
||||
let trunk = self.state.lock().await.trunk.clone()?;
|
||||
trunk.codex.session.ensure_rollout_materialized().await;
|
||||
match trunk.codex.session.current_rollout_path().await {
|
||||
Ok(path) => path,
|
||||
Err(err) => {
|
||||
warn!("failed to resolve guardian trunk rollout path: {err}");
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn shutdown(&self) {
|
||||
let (review_session, ephemeral_reviews) = {
|
||||
let mut state = self.state.lock().await;
|
||||
|
||||
@@ -4693,6 +4693,38 @@ async fn shutdown_and_wait_shuts_down_cached_guardian_subagent() {
|
||||
.expect("guardian subagent should receive a shutdown op");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn cached_guardian_subagent_exposes_its_rollout_path() {
|
||||
let (parent_session, _parent_turn_context) = make_session_and_context().await;
|
||||
let parent_session = Arc::new(parent_session);
|
||||
|
||||
let (mut child_session, _child_turn_context) = make_session_and_context().await;
|
||||
let child_rollout_path = attach_thread_persistence(&mut child_session).await;
|
||||
let (child_tx_sub, _child_rx_sub) = async_channel::bounded(4);
|
||||
let (_child_tx_event, child_rx_event) = async_channel::unbounded();
|
||||
let (_child_status_tx, child_agent_status) = watch::channel(AgentStatus::PendingInit);
|
||||
let child_session_loop_handle = tokio::spawn(async {});
|
||||
let child_codex = Codex {
|
||||
tx_sub: child_tx_sub,
|
||||
rx_event: child_rx_event,
|
||||
agent_status: child_agent_status,
|
||||
session: Arc::new(child_session),
|
||||
session_loop_termination: session_loop_termination_from_handle(child_session_loop_handle),
|
||||
};
|
||||
parent_session
|
||||
.guardian_review_session
|
||||
.cache_for_test(child_codex)
|
||||
.await;
|
||||
|
||||
assert_eq!(
|
||||
parent_session
|
||||
.guardian_review_session
|
||||
.trunk_rollout_path()
|
||||
.await,
|
||||
Some(child_rollout_path)
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn shutdown_and_wait_shuts_down_tracked_ephemeral_guardian_review() {
|
||||
let (parent_session, parent_turn_context) = make_session_and_context().await;
|
||||
|
||||
Reference in new issue
Block a user