fix(app-server) revert null instructions changes (#17047)

This commit is contained in:
Dylan Hurd
2026-04-07 15:18:34 -07:00
committed by GitHub
parent f480b98984
commit 6c36e7d688
48 changed files with 102 additions and 671 deletions

View File

@@ -56,7 +56,6 @@ async fn extract_metadata_from_rollout_uses_session_meta() {
agent_role: None,
model_provider: Some("openai".to_string()),
base_instructions: None,
developer_instructions: None,
dynamic_tools: None,
memory_mode: None,
};
@@ -108,7 +107,6 @@ async fn extract_metadata_from_rollout_returns_latest_memory_mode() {
agent_role: None,
model_provider: Some("openai".to_string()),
base_instructions: None,
developer_instructions: None,
dynamic_tools: None,
memory_mode: None,
};
@@ -371,7 +369,6 @@ fn write_rollout_in_sessions_with_cwd(
agent_role: None,
model_provider: Some("test-provider".to_string()),
base_instructions: None,
developer_instructions: None,
dynamic_tools: None,
memory_mode: None,
};

View File

@@ -81,8 +81,7 @@ pub enum RolloutRecorderParams {
conversation_id: ThreadId,
forked_from_id: Option<ThreadId>,
source: SessionSource,
base_instructions: Option<BaseInstructions>,
developer_instructions: Option<Option<String>>,
base_instructions: BaseInstructions,
dynamic_tools: Vec<DynamicToolSpec>,
event_persistence_mode: EventPersistenceMode,
},
@@ -111,8 +110,7 @@ impl RolloutRecorderParams {
conversation_id: ThreadId,
forked_from_id: Option<ThreadId>,
source: SessionSource,
base_instructions: Option<BaseInstructions>,
developer_instructions: Option<Option<String>>,
base_instructions: BaseInstructions,
dynamic_tools: Vec<DynamicToolSpec>,
event_persistence_mode: EventPersistenceMode,
) -> Self {
@@ -121,7 +119,6 @@ impl RolloutRecorderParams {
forked_from_id,
source,
base_instructions,
developer_instructions,
dynamic_tools,
event_persistence_mode,
}
@@ -383,7 +380,6 @@ impl RolloutRecorder {
forked_from_id,
source,
base_instructions,
developer_instructions,
dynamic_tools,
event_persistence_mode,
} => {
@@ -413,7 +409,6 @@ impl RolloutRecorder {
source,
model_provider: Some(config.model_provider_id().to_string()),
base_instructions: Some(base_instructions),
developer_instructions,
dynamic_tools: if dynamic_tools.is_empty() {
None
} else {

View File

@@ -73,8 +73,7 @@ async fn recorder_materializes_only_after_explicit_persist() -> std::io::Result<
thread_id,
/*forked_from_id*/ None,
SessionSource::Exec,
Some(BaseInstructions::default()),
/*developer_instructions*/ None,
BaseInstructions::default(),
Vec::new(),
EventPersistenceMode::Limited,
),
@@ -167,8 +166,7 @@ async fn metadata_irrelevant_events_touch_state_db_updated_at() -> std::io::Resu
thread_id,
/*forked_from_id*/ None,
SessionSource::Cli,
Some(BaseInstructions::default()),
/*developer_instructions*/ None,
BaseInstructions::default(),
Vec::new(),
EventPersistenceMode::Limited,
),

View File

@@ -977,7 +977,7 @@ async fn test_get_thread_contents() {
}
#[tokio::test]
async fn test_base_instructions_missing_in_meta_stays_missing() {
async fn test_base_instructions_missing_in_meta_defaults_to_null() {
let temp = TempDir::new().unwrap();
let home = temp.path();
@@ -1011,7 +1011,10 @@ async fn test_base_instructions_missing_in_meta_stays_missing() {
.await
.expect("session meta head");
let first = head.first().expect("first head entry");
assert_eq!(first.get("base_instructions"), None);
assert_eq!(
first.get("base_instructions"),
Some(&serde_json::Value::Null)
);
}
#[tokio::test]
@@ -1140,7 +1143,6 @@ async fn test_updated_at_uses_file_mtime() -> Result<()> {
agent_role: None,
model_provider: Some("test-provider".into()),
base_instructions: None,
developer_instructions: None,
dynamic_tools: None,
memory_mode: None,
},