diff --git a/work-items/open/20260529-235408-provider-stream-trace-profile-spawn/artifacts/.gitkeep b/work-items/closed/20260529-235408-provider-stream-trace-profile-spawn/artifacts/.gitkeep similarity index 100% rename from work-items/open/20260529-235408-provider-stream-trace-profile-spawn/artifacts/.gitkeep rename to work-items/closed/20260529-235408-provider-stream-trace-profile-spawn/artifacts/.gitkeep diff --git a/work-items/open/20260529-235408-provider-stream-trace-profile-spawn/item.md b/work-items/closed/20260529-235408-provider-stream-trace-profile-spawn/item.md similarity index 98% rename from work-items/open/20260529-235408-provider-stream-trace-profile-spawn/item.md rename to work-items/closed/20260529-235408-provider-stream-trace-profile-spawn/item.md index a46403f0..479407af 100644 --- a/work-items/open/20260529-235408-provider-stream-trace-profile-spawn/item.md +++ b/work-items/closed/20260529-235408-provider-stream-trace-profile-spawn/item.md @@ -2,12 +2,12 @@ id: 20260529-235408-provider-stream-trace-profile-spawn slug: provider-stream-trace-profile-spawn title: Preserve provider stream trace recording across profile-spawned Pods -status: open +status: closed kind: task priority: P2 labels: [pod, profile, session-trace, debuggability] created_at: 2026-05-29T23:54:08Z -updated_at: 2026-05-30T00:23:45Z +updated_at: 2026-05-30T00:38:28Z assignee: null legacy_ticket: null --- diff --git a/work-items/closed/20260529-235408-provider-stream-trace-profile-spawn/resolution.md b/work-items/closed/20260529-235408-provider-stream-trace-profile-spawn/resolution.md new file mode 100644 index 00000000..479407af --- /dev/null +++ b/work-items/closed/20260529-235408-provider-stream-trace-profile-spawn/resolution.md @@ -0,0 +1,41 @@ +--- +id: 20260529-235408-provider-stream-trace-profile-spawn +slug: provider-stream-trace-profile-spawn +title: Preserve provider stream trace recording across profile-spawned Pods +status: closed +kind: task +priority: P2 +labels: [pod, profile, session-trace, debuggability] +created_at: 2026-05-29T23:54:08Z +updated_at: 2026-05-30T00:38:28Z +assignee: null +legacy_ticket: null +--- + +## Background + +`SessionConfig::record_event_trace` controls the debug sidecar `{segment_id}.trace.jsonl`, which records normalized provider stream events and lifecycle markers outside the durable segment log. It is intentionally separate from session replay, but it is important when diagnosing provider failures that are visible only as live events. + +During the `session-pod-state-boundary` implementation handoff, a child Pod showed `[ProviderError]` with `error_code: context_length_exceeded` in TUI for a `ping` request. The child's session JSONL had no `run_errored`, and there was no `.trace.jsonl` sidecar. Inspecting the child's runtime manifest showed: + +```toml +[session] +record_event_trace = false +``` + +This suggests the profile/spawn configuration path may have dropped or reset a previously enabled debug trace setting when profiles were introduced or when `SpawnPod` materializes its child manifest. Even if the immediate provider-error persistence bug is fixed separately, disabling the trace sidecar for child Pods makes diagnosis of live-only provider events much harder. + +The current trace sidecar is not fully raw SSE; it records parsed `llm_worker::llm_client::event::Event` values plus lifecycle/transport diagnostics. Unknown OpenAI Responses SSE events are surfaced as `Event::UnhandledSse` with bounded previews, while known terminal events such as `response.failed` become `Event::Error`. + +## Goal + +Make provider stream/event trace configuration survive profile resolution and spawned-Pod manifest construction so debugging settings remain effective for child Pods, and make the resulting behavior explicit. + +## Acceptance criteria + +- Identify where `session.record_event_trace` is lost or defaulted during profile resolution, manifestization, `SpawnPod`, or hidden spawn-config construction. +- Preserve the intended trace setting for spawned Pods when the parent/profile configuration enables it, unless an explicit child override disables it. +- Add focused tests covering profile-resolved manifests and spawned-Pod manifest construction with `record_event_trace = true`. +- Clarify in docs or comments that `.trace.jsonl` stores normalized stream events/lifecycle diagnostics, not necessarily byte-for-byte raw SSE. +- Do not make event trace globally enabled by default; it remains an opt-in debugging feature. +- Validate with focused manifest/pod tests and `./tickets.sh doctor`. diff --git a/work-items/closed/20260529-235408-provider-stream-trace-profile-spawn/thread.md b/work-items/closed/20260529-235408-provider-stream-trace-profile-spawn/thread.md new file mode 100644 index 00000000..3c94a4d4 --- /dev/null +++ b/work-items/closed/20260529-235408-provider-stream-trace-profile-spawn/thread.md @@ -0,0 +1,102 @@ + + +## Created + +Created by tickets.sh create. + +--- + + + +## Plan + +Use the worktree + sibling coder/reviewer flow for this ticket. + +Intent packet summary: +- Preserve `session.record_event_trace` through profile resolution and spawned-Pod manifest construction when the parent/profile enables it. +- Keep event trace opt-in; do not globally enable it by default. +- Treat `.trace.jsonl` as normalized provider stream/lifecycle diagnostics, not byte-for-byte raw SSE. + +Implementation direction: +- Trace where `record_event_trace` is carried in profile-resolved manifests and where `SpawnPod` constructs hidden child spawn config. +- Fix the narrow point where the setting is dropped/defaulted. +- Add focused tests for profile/spawn config preserving `record_event_trace = true`. +- Add a small documentation/comment clarification for trace sidecar semantics. + +Validation target: +- Focused manifest/pod tests covering the changed path. +- `./tickets.sh doctor` and `git diff --check`. + + +--- + + + +## Review: approve + +Approve. + +The change narrowly fixes the hidden `--spawn-config-json` loss point by carrying the already-resolved spawner `manifest.session.record_event_trace` into `SpawnPodTool` and serializing `[session].record_event_trace = true` only when the parent has opted in. It also adds focused coverage for profile artifact preservation, spawned config preservation, disabled omission, and clarifies trace sidecar semantics as normalized provider/lifecycle diagnostics rather than byte-for-byte raw SSE. + +Blocker findings: none. + +Validation re-run by reviewer: +- `cargo test -p manifest profile_artifact_preserves_session_record_event_trace` — passed. +- `cargo test -p pod spawn_config` — passed, 4 tests. +- `./tickets.sh doctor` — passed. +- `git diff --check 23f234d^ 23f234d` — passed earlier during inspection. +- Worktree status is clean. + +Final verdict: approve. + + +--- + + + +## Closed + +--- +id: 20260529-235408-provider-stream-trace-profile-spawn +slug: provider-stream-trace-profile-spawn +title: Preserve provider stream trace recording across profile-spawned Pods +status: closed +kind: task +priority: P2 +labels: [pod, profile, session-trace, debuggability] +created_at: 2026-05-29T23:54:08Z +updated_at: 2026-05-30T00:38:28Z +assignee: null +legacy_ticket: null +--- + +## Background + +`SessionConfig::record_event_trace` controls the debug sidecar `{segment_id}.trace.jsonl`, which records normalized provider stream events and lifecycle markers outside the durable segment log. It is intentionally separate from session replay, but it is important when diagnosing provider failures that are visible only as live events. + +During the `session-pod-state-boundary` implementation handoff, a child Pod showed `[ProviderError]` with `error_code: context_length_exceeded` in TUI for a `ping` request. The child's session JSONL had no `run_errored`, and there was no `.trace.jsonl` sidecar. Inspecting the child's runtime manifest showed: + +```toml +[session] +record_event_trace = false +``` + +This suggests the profile/spawn configuration path may have dropped or reset a previously enabled debug trace setting when profiles were introduced or when `SpawnPod` materializes its child manifest. Even if the immediate provider-error persistence bug is fixed separately, disabling the trace sidecar for child Pods makes diagnosis of live-only provider events much harder. + +The current trace sidecar is not fully raw SSE; it records parsed `llm_worker::llm_client::event::Event` values plus lifecycle/transport diagnostics. Unknown OpenAI Responses SSE events are surfaced as `Event::UnhandledSse` with bounded previews, while known terminal events such as `response.failed` become `Event::Error`. + +## Goal + +Make provider stream/event trace configuration survive profile resolution and spawned-Pod manifest construction so debugging settings remain effective for child Pods, and make the resulting behavior explicit. + +## Acceptance criteria + +- Identify where `session.record_event_trace` is lost or defaulted during profile resolution, manifestization, `SpawnPod`, or hidden spawn-config construction. +- Preserve the intended trace setting for spawned Pods when the parent/profile configuration enables it, unless an explicit child override disables it. +- Add focused tests covering profile-resolved manifests and spawned-Pod manifest construction with `record_event_trace = true`. +- Clarify in docs or comments that `.trace.jsonl` stores normalized stream events/lifecycle diagnostics, not necessarily byte-for-byte raw SSE. +- Do not make event trace globally enabled by default; it remains an opt-in debugging feature. +- Validate with focused manifest/pod tests and `./tickets.sh doctor`. + + +--- diff --git a/work-items/open/20260529-235408-provider-stream-trace-profile-spawn/thread.md b/work-items/open/20260529-235408-provider-stream-trace-profile-spawn/thread.md deleted file mode 100644 index 4076d214..00000000 --- a/work-items/open/20260529-235408-provider-stream-trace-profile-spawn/thread.md +++ /dev/null @@ -1,53 +0,0 @@ - - -## Created - -Created by tickets.sh create. - ---- - - - -## Plan - -Use the worktree + sibling coder/reviewer flow for this ticket. - -Intent packet summary: -- Preserve `session.record_event_trace` through profile resolution and spawned-Pod manifest construction when the parent/profile enables it. -- Keep event trace opt-in; do not globally enable it by default. -- Treat `.trace.jsonl` as normalized provider stream/lifecycle diagnostics, not byte-for-byte raw SSE. - -Implementation direction: -- Trace where `record_event_trace` is carried in profile-resolved manifests and where `SpawnPod` constructs hidden child spawn config. -- Fix the narrow point where the setting is dropped/defaulted. -- Add focused tests for profile/spawn config preserving `record_event_trace = true`. -- Add a small documentation/comment clarification for trace sidecar semantics. - -Validation target: -- Focused manifest/pod tests covering the changed path. -- `./tickets.sh doctor` and `git diff --check`. - - ---- - - - -## Review: approve - -Approve. - -The change narrowly fixes the hidden `--spawn-config-json` loss point by carrying the already-resolved spawner `manifest.session.record_event_trace` into `SpawnPodTool` and serializing `[session].record_event_trace = true` only when the parent has opted in. It also adds focused coverage for profile artifact preservation, spawned config preservation, disabled omission, and clarifies trace sidecar semantics as normalized provider/lifecycle diagnostics rather than byte-for-byte raw SSE. - -Blocker findings: none. - -Validation re-run by reviewer: -- `cargo test -p manifest profile_artifact_preserves_session_record_event_trace` — passed. -- `cargo test -p pod spawn_config` — passed, 4 tests. -- `./tickets.sh doctor` — passed. -- `git diff --check 23f234d^ 23f234d` — passed earlier during inspection. -- Worktree status is clean. - -Final verdict: approve. - - ----