Skip to content

Separate translator checkpoints from finalization - #38

Merged
Stephen Belanger (Qard) merged 2 commits into
mainfrom
fix/translator-checkpoint-finalize
Sep 1, 2026
Merged

Separate translator checkpoints from finalization#38
Stephen Belanger (Qard) merged 2 commits into
mainfrom
fix/translator-checkpoint-finalize

Conversation

@Qard

Copy link
Copy Markdown
Collaborator

What this changes

A delivery flush and a session shutdown are different lifecycle events. Previously both called the same translator flush method, so an ordinary delivery barrier could close the live session root, turn, and pending work. Later events then reused state that had already been finalized.

This PR gives that distinction one shared daemon contract:

  • checkpoint catches up externally buffered observations and flushes the sink without ending the logical session
  • finalize runs only when the session actor shuts down or is retired
  • Codex catches up transcript rows in both paths but closes dangling work only during finalization
  • Claude Code, Antigravity, OpenCode, and Pi keep state across checkpoints and defensively close incomplete work during finalization
  • Pi and OpenCode now preserve interrupted LLM/tool spans as explicit errored spans instead of silently dropping them

This is the translator-lifecycle slice extracted from #26. It deliberately does not include source identity, managed-run, import, or distribution changes.

Current-main and overlap check

Rebuilt directly on current main at c29184b. The open PRs were reviewed before publishing: #28 concerns JavaScript span transforms, #33 removes MCP proxy packages, and #26 is the omnibus being replaced. None implements this lifecycle separation.

Validation

  • cargo fmt --manifest-path bt-daemon/Cargo.toml -- --check
  • cargo clippy --manifest-path bt-daemon/Cargo.toml --all-targets --all-features -- -D warnings
  • cargo test --manifest-path bt-daemon/Cargo.toml --all-features

The four real-agent tests remain ignored because they require installed agent CLIs and credentials; all deterministic tests pass.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T14:19:24.152048Z 6c9c548 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c9c5482dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread bt-daemon/src/dispatch.rs Outdated
@Qard
Stephen Belanger (Qard) merged commit ddd1c3a into main Sep 1, 2026
20 checks passed
@Qard
Stephen Belanger (Qard) deleted the fix/translator-checkpoint-finalize branch September 1, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants