Refine realtime startup context formatting (#13560)

## Summary
- group recent work by git repo when available, otherwise by directory
- render recent work as bounded user asks with per-thread cwd context
- exclude hidden files and directories from workspace trees
This commit is contained in:
Ahmed Ibrahim
2026-03-05 16:31:20 -08:00
committed by GitHub
parent c3736cff0a
commit 6cf0ed4e79
5 changed files with 794 additions and 14 deletions

View File

@@ -36,6 +36,7 @@ use tempfile::TempDir;
use tokio::time::timeout;
const DEFAULT_TIMEOUT: Duration = Duration::from_secs(10);
const STARTUP_CONTEXT_HEADER: &str = "Startup context from Codex.";
#[tokio::test]
async fn realtime_conversation_streams_v2_notifications() -> Result<()> {
@@ -114,6 +115,18 @@ async fn realtime_conversation_streams_v2_notifications() -> Result<()> {
assert_eq!(started.thread_id, thread_start.thread.id);
assert!(started.session_id.is_some());
let startup_context_request = realtime_server.wait_for_request(0, 0).await;
assert_eq!(
startup_context_request.body_json()["type"].as_str(),
Some("session.update")
);
assert!(
startup_context_request.body_json()["session"]["instructions"]
.as_str()
.context("expected startup context instructions")?
.contains(STARTUP_CONTEXT_HEADER)
);
let audio_append_request_id = mcp
.send_thread_realtime_append_audio_request(ThreadRealtimeAppendAudioParams {
thread_id: started.thread_id.clone(),
@@ -183,6 +196,12 @@ async fn realtime_conversation_streams_v2_notifications() -> Result<()> {
connection[0].body_json()["type"].as_str(),
Some("session.update")
);
assert!(
connection[0].body_json()["session"]["instructions"]
.as_str()
.context("expected startup context instructions")?
.contains(STARTUP_CONTEXT_HEADER)
);
let mut request_types = [
connection[1].body_json()["type"]
.as_str()