Repository navigation
refactor(import): register transcript import per agent - #140
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
Stephen Belanger (Qard)
force-pushed
the
refactor/register-translators
branch
from
October 6, 2026 13:24
caadc9e to
4a46d82
Compare
Stephen Belanger (Qard)
force-pushed
the
refactor/register-import
branch
from
October 6, 2026 13:24
fa4201a to
e2cad0a
Compare
Abhijeet Prasad (AbhiPrasad)
approved these changes
Oct 6, 2026
Stephen Belanger (Qard)
force-pushed
the
refactor/register-translators
branch
from
October 6, 2026 14:04
4a46d82 to
6184632
Compare
Stephen Belanger (Qard)
force-pushed
the
refactor/register-import
branch
from
October 6, 2026 14:04
e2cad0a to
288d9ab
Compare
Stephen Belanger (Qard)
force-pushed
the
refactor/register-translators
branch
from
October 6, 2026 14:48
6184632 to
86eb942
Compare
Stephen Belanger (Qard)
force-pushed
the
refactor/register-import
branch
from
October 6, 2026 14:48
288d9ab to
7cbd972
Compare
Stephen Belanger (Qard)
force-pushed
the
refactor/register-translators
branch
from
October 6, 2026 15:03
86eb942 to
b6fe0b1
Compare
Stephen Belanger (Qard)
force-pushed
the
refactor/register-import
branch
from
October 6, 2026 15:03
7cbd972 to
0545f64
Compare
Stephen Belanger (Qard)
force-pushed
the
refactor/register-translators
branch
from
October 6, 2026 16:59
b6fe0b1 to
ed5dc88
Compare
Stephen Belanger (Qard)
force-pushed
the
refactor/register-import
branch
3 times, most recently
from
October 6, 2026 17:20
c4c4589 to
beb70d1
Compare
Transcript import dispatched on ImportSource in seven places, and the generic TranscriptTail carried Cursor's snapshot and rewrite handling inline. Each importable agent now implements `TranscriptImport` (roots, session ids, filename matching) and supplies a `TailSession` that turns records into synthetic hook events. The Codex, Claude Code, Cursor and Antigravity agents register it. Cursor's tail owns its private transcript snapshot and declares that it keeps its translator across rewrites and tolerates an incomplete final record, so TranscriptTail no longer special-cases any agent. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Stephen Belanger (Qard)
force-pushed
the
refactor/register-import
branch
from
October 6, 2026 17:25
beb70d1 to
be82113
Compare
TranscriptImport exposed each agent's search roots and filename rules because the shared discovery code in transcript_import walked the directories itself and called back into the agent for policy. The trait now offers only what callers need: `discover`, `find` and `tail`. The shared directory walk, session grouping and error messages move into a small `TranscriptLayout` that each agent builds privately from its roots and naming rules. Those rules are now private to the agent's module. Tests exercise each agent's layout with temporary roots, which keeps them independent of the CODEX_HOME and CLAUDE_CONFIG_DIR overrides. Search paths, matching and error messages are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Based on
mainnow that #139 has merged. This is the last PR of the registration series.Transcript import matched on
ImportSourcein seven places: roots, session id, filename match, envelope construction, tail state construction (twice), and polling. The genericTranscriptTailalso had about 60 lines of Cursor-only snapshot and rewrite handling inline.Each importable agent now implements a capability trait and supplies its own tail:
TranscriptImport.Tailstruct implementsTailSession.rewrittenhook computes which records survived a rewrite.TranscriptTailholds aBox<dyn TailSession>and no longer mentions any agent.Discovery is internal to each agent. Callers only need
discover,findandtail, so each agent's search roots and filename rules are private to its module. The shared directory walk, session grouping and error messages live in a smallTranscriptLayout(roots, a session-id rule and a filename rule) that each agent builds privately. Tests exercise each agent's layout with temporary roots, so they stay independent of theCODEX_HOMEandCLAUDE_CONFIG_DIRoverrides.Behaviour
None. Search paths, matching and error messages are unchanged. Cursor's snapshot is still recreated after a rewrite and receives only the records that changed. Other agents still get a fresh translator after a rewrite.
Testing
cargo clippy --all-features --all-targets -D warningsis clean.cargo test --all-features --no-fail-fast: everything passes, including the Cursor attach/rewrite import tests, excepttrace_runtime::tests::doctor_reports_a_daemon_that_{cannot_authenticate_the_route,resolves_other_credentials}. Those fail the same way onmainin my local environment.🤖 Generated with Claude Code