fix: preserve spawn event trace setting

This commit is contained in:
2026-05-30 09:30:05 +09:00
parent 31bd50137d
commit 23f234d095
6 changed files with 92 additions and 11 deletions
+6 -4
View File
@@ -9,7 +9,8 @@ mod scope;
pub use cascade::{LayerLoadError, find_project_manifest_from, load_layer};
pub use config::{
CompactionConfigPartial, FileUploadLimitsPartial, PermissionConfigPartial, PodManifestConfig,
PodMetaConfig, ResolveError, ToolOutputLimitsPartial, WorkerManifestConfig,
PodMetaConfig, ResolveError, SessionConfigPartial, ToolOutputLimitsPartial,
WorkerManifestConfig,
};
pub use model::{
AuthRef, ModelCapability, ModelManifest, ReasoningControl, ReasoningEffort, SchemeKind,
@@ -395,9 +396,10 @@ pub struct ScopeConfig {
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)]
pub struct SessionConfig {
/// Persist every provider stream event directly to `trace.jsonl` next to the
/// segment log. Intended for debugging stalls between stream requests; off
/// by default because it can be verbose.
/// Persist normalized provider stream events and lifecycle diagnostics to a
/// `.trace.jsonl` sidecar next to the segment log. This is not guaranteed to
/// be a byte-for-byte raw SSE capture. Intended for debugging stalls between
/// stream requests; off by default because it can be verbose.
#[serde(default)]
pub record_event_trace: bool,
}
+21
View File
@@ -898,6 +898,27 @@ mod tests {
);
}
#[test]
fn profile_artifact_preserves_session_record_event_trace() {
let mut raw = artifact();
raw["manifest"]["session"] = serde_json::json!({ "record_event_trace": true });
let resolved = resolve_profile_artifact(
ProfileSource::Path {
path: PathBuf::from("/profiles/coder.nix"),
},
Path::new("/workspace/project"),
raw,
)
.unwrap();
assert!(resolved.manifest.session.record_event_trace);
assert_eq!(
resolved.manifest_snapshot["session"]["record_event_trace"],
serde_json::json!(true)
);
}
#[test]
fn rejects_both_manifest_and_config_fields() {
let err = resolve_profile_artifact(