From d9a88fbd8876ac512db383694ea964e53c40e10a Mon Sep 17 00:00:00 2001 From: Hare Date: Wed, 3 Jun 2026 11:15:13 +0900 Subject: [PATCH] ticket: close reasoning block lifecycle --- .../artifacts/.gitkeep | 0 .../artifacts/delegation-intent.md | 0 .../artifacts/implementation-report.md | 0 .../artifacts/review.md | 57 ++++++++++++++ .../item.md | 4 +- .../resolution.md | 1 + .../thread.md | 74 +++++++++++++++++++ 7 files changed, 134 insertions(+), 2 deletions(-) rename work-items/{open => closed}/20260603-001124-unify-reasoning-block-lifecycle/artifacts/.gitkeep (100%) rename work-items/{open => closed}/20260603-001124-unify-reasoning-block-lifecycle/artifacts/delegation-intent.md (100%) rename work-items/{open => closed}/20260603-001124-unify-reasoning-block-lifecycle/artifacts/implementation-report.md (100%) create mode 100644 work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/artifacts/review.md rename work-items/{open => closed}/20260603-001124-unify-reasoning-block-lifecycle/item.md (98%) create mode 100644 work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/resolution.md rename work-items/{open => closed}/20260603-001124-unify-reasoning-block-lifecycle/thread.md (58%) diff --git a/work-items/open/20260603-001124-unify-reasoning-block-lifecycle/artifacts/.gitkeep b/work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/artifacts/.gitkeep similarity index 100% rename from work-items/open/20260603-001124-unify-reasoning-block-lifecycle/artifacts/.gitkeep rename to work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/artifacts/.gitkeep diff --git a/work-items/open/20260603-001124-unify-reasoning-block-lifecycle/artifacts/delegation-intent.md b/work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/artifacts/delegation-intent.md similarity index 100% rename from work-items/open/20260603-001124-unify-reasoning-block-lifecycle/artifacts/delegation-intent.md rename to work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/artifacts/delegation-intent.md diff --git a/work-items/open/20260603-001124-unify-reasoning-block-lifecycle/artifacts/implementation-report.md b/work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/artifacts/implementation-report.md similarity index 100% rename from work-items/open/20260603-001124-unify-reasoning-block-lifecycle/artifacts/implementation-report.md rename to work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/artifacts/implementation-report.md diff --git a/work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/artifacts/review.md b/work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/artifacts/review.md new file mode 100644 index 00000000..24eb04bd --- /dev/null +++ b/work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/artifacts/review.md @@ -0,0 +1,57 @@ +# Review: unify reasoning block lifecycle + +Reviewer Pods: + +- Initial review: `reasoning-block-lifecycle-reviewer-20260603` +- Re-review: `reasoning-block-lifecycle-rereviewer-20260603` + +## Result + +Approved after fixes. No remaining blockers. + +## Initial blocker + +The initial reviewer found that OpenAI Responses text-bearing reasoning items produced two live-visible Thinking lifecycles: + +1. streamed `reasoning_text.delta` used the real Thinking block; +2. later `response.output_item.done` emitted a second synthetic empty Thinking block to carry persistence metadata. + +That preserved persistence but changed live callback/trace semantics beyond the intended event-model cleanup. + +## Fix verification + +Coder added commit `abb6adb fix: preserve openai reasoning live stops`. + +The re-review confirmed: + +- text-bearing OpenAI reasoning now attaches `ReasoningBlockData` to the deferred existing Thinking block stop; +- no second synthetic empty Thinking start/stop is emitted for text-bearing reasoning; +- metadata-only OpenAI reasoning still persists through a synthetic metadata-bearing Thinking block when no live reasoning text block exists; +- Anthropic signature/redacted material and OpenAI id/summary/encrypted_content remain carried through `ReasoningBlockData`; +- the old `ReasoningItem` event/collector/Timeline side channel was not reintroduced. + +## Validation evidence + +Coder reported: + +- `cargo test -p llm-worker --lib` +- `cargo test -p llm-worker --test reasoning_round_trip_test` +- `cargo check --workspace --all-targets` +- `./tickets.sh doctor` +- `git diff --check` +- `nix build .#yoi` + +Parent/orchestrator reran after merge: + +- `cargo test -p llm-worker openai_responses::events::tests::reasoning --lib` +- `cargo test -p llm-worker --lib` +- `cargo test -p llm-worker --test reasoning_round_trip_test` +- `cargo check --workspace --all-targets` +- `./tickets.sh doctor` +- `git diff --check` +- `nix build .#yoi` +- `./result/bin/yoi pod --help` + +## Residual risk + +Low. OpenAI Responses reasoning-text block stop is intentionally delayed until `response.output_item.done` so provider persistence metadata can be attached to the same Thinking block lifecycle. The remaining edge risk is unusual ordering/error behavior around multiple concurrent Thinking scopes, but the implementation now keys Thinking scopes by block index and focused tests cover the reviewed duplicate-stop sequence. diff --git a/work-items/open/20260603-001124-unify-reasoning-block-lifecycle/item.md b/work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/item.md similarity index 98% rename from work-items/open/20260603-001124-unify-reasoning-block-lifecycle/item.md rename to work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/item.md index aadd4db5..9220e5fb 100644 --- a/work-items/open/20260603-001124-unify-reasoning-block-lifecycle/item.md +++ b/work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/item.md @@ -2,12 +2,12 @@ id: 20260603-001124-unify-reasoning-block-lifecycle slug: unify-reasoning-block-lifecycle title: Unify reasoning persistence with block lifecycle -status: open +status: closed kind: task priority: P2 labels: [llm-worker, reasoning, timeline] created_at: 2026-06-03T00:11:24Z -updated_at: 2026-06-03T00:51:09Z +updated_at: 2026-06-03T02:15:02Z assignee: null legacy_ticket: null --- diff --git a/work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/resolution.md b/work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/resolution.md new file mode 100644 index 00000000..9f928edd --- /dev/null +++ b/work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/resolution.md @@ -0,0 +1 @@ +Unified reasoning persistence with the Thinking block lifecycle. Removed the separate ReasoningItem event/collector path; Anthropic and OpenAI Responses reasoning metadata now persist via block stop metadata; reviewer blocker fixed; focused tests and nix build passed. diff --git a/work-items/open/20260603-001124-unify-reasoning-block-lifecycle/thread.md b/work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/thread.md similarity index 58% rename from work-items/open/20260603-001124-unify-reasoning-block-lifecycle/thread.md rename to work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/thread.md index 63c78e50..9f8d2961 100644 --- a/work-items/open/20260603-001124-unify-reasoning-block-lifecycle/thread.md +++ b/work-items/closed/20260603-001124-unify-reasoning-block-lifecycle/thread.md @@ -75,4 +75,78 @@ Completion report: - whether ready for external review. +--- + + + +## Review: approve + +# Review: unify reasoning block lifecycle + +Reviewer Pods: + +- Initial review: `reasoning-block-lifecycle-reviewer-20260603` +- Re-review: `reasoning-block-lifecycle-rereviewer-20260603` + +## Result + +Approved after fixes. No remaining blockers. + +## Initial blocker + +The initial reviewer found that OpenAI Responses text-bearing reasoning items produced two live-visible Thinking lifecycles: + +1. streamed `reasoning_text.delta` used the real Thinking block; +2. later `response.output_item.done` emitted a second synthetic empty Thinking block to carry persistence metadata. + +That preserved persistence but changed live callback/trace semantics beyond the intended event-model cleanup. + +## Fix verification + +Coder added commit `abb6adb fix: preserve openai reasoning live stops`. + +The re-review confirmed: + +- text-bearing OpenAI reasoning now attaches `ReasoningBlockData` to the deferred existing Thinking block stop; +- no second synthetic empty Thinking start/stop is emitted for text-bearing reasoning; +- metadata-only OpenAI reasoning still persists through a synthetic metadata-bearing Thinking block when no live reasoning text block exists; +- Anthropic signature/redacted material and OpenAI id/summary/encrypted_content remain carried through `ReasoningBlockData`; +- the old `ReasoningItem` event/collector/Timeline side channel was not reintroduced. + +## Validation evidence + +Coder reported: + +- `cargo test -p llm-worker --lib` +- `cargo test -p llm-worker --test reasoning_round_trip_test` +- `cargo check --workspace --all-targets` +- `./tickets.sh doctor` +- `git diff --check` +- `nix build .#yoi` + +Parent/orchestrator reran after merge: + +- `cargo test -p llm-worker openai_responses::events::tests::reasoning --lib` +- `cargo test -p llm-worker --lib` +- `cargo test -p llm-worker --test reasoning_round_trip_test` +- `cargo check --workspace --all-targets` +- `./tickets.sh doctor` +- `git diff --check` +- `nix build .#yoi` +- `./result/bin/yoi pod --help` + +## Residual risk + +Low. OpenAI Responses reasoning-text block stop is intentionally delayed until `response.output_item.done` so provider persistence metadata can be attached to the same Thinking block lifecycle. The remaining edge risk is unusual ordering/error behavior around multiple concurrent Thinking scopes, but the implementation now keys Thinking scopes by block index and focused tests cover the reviewed duplicate-stop sequence. + + +--- + + + +## Closed + +Unified reasoning persistence with the Thinking block lifecycle. Removed the separate ReasoningItem event/collector path; Anthropic and OpenAI Responses reasoning metadata now persist via block stop metadata; reviewer blocker fixed; focused tests and nix build passed. + + ---