You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maka has two user-facing paths over the same Codex and Claude session stores:
ForeignSession creates a filtered, untrusted handoff for the current task.
ExternalSession imports a full typed transcript as a new Maka Session.
Their outputs should remain different, but each path currently implements its own discovery, source identity, title and cwd selection, bounded reading, and source-specific parsing. The implementations have already drifted: Codex paths use different presentation records, while Claude handoff does not share the lineage resolution used by full import.
Desired outcome
Use one package-private source catalog and native parser per external source, followed by two explicit projections: safe handoff and full Session import.
The consolidation should:
select the same source ID, transcript candidate, title, and cwd under the same query policy;
use one Codex record authority and one Claude lineage resolver before projection;
preserve the handoff security boundary, redaction, and hostile-data envelope;
preserve typed full history, externalOrigin, atomic persistence, and replay;
cover Codex v0.144 and v0.149, Claude rewind and compaction, duplicate IDs, malformed records, and tool call/result pairing with shared fixtures; and
strictly reduce production code and duplicated tests without adding another facade, compatibility bridge, or generic ExternalMessage model.
Coordinate with #1512 and #3520. Preserve #1512's staleness and hostile-path requirements, and reuse #3520's v0.149 fixture and record-selection fix.
Alternatives or workarounds
Keeping the parsers independent preserves the current duplication and allows source interpretation to drift further. Deriving safe handoff from imported StoredMessage[] would also weaken the explicit trust boundary, so the two projections should remain separate after shared source resolution.
AI-assisted analysis: Codex agents traced both consumers, their security boundaries, related pull requests, and checked-in fixtures. A human contributor must review the final design and implementation.
I reviewed the current ForeignSession handoff and ExternalSession import paths. They independently perform source discovery, transcript selection, metadata extraction, bounded reading, and source-specific parsing, which has already caused their Codex and Claude behavior to diverge.
Claude: share lineage resolution for rewinds, compaction boundaries, duplicate records, and malformed records.
Keep the two projections explicit and separate:
safe handoff with redaction, hostile-data envelope, tool-output exclusion, staleness checks, and bounded reads;
full Maka Session import with typed history, tool call/result pairing, externalOrigin, atomic persistence, and replay.
Add shared fixtures and parity tests, then remove the duplicated production code and tests.
I will not introduce a generic ExternalMessage model or derive the handoff from imported StoredMessage[], since that would weaken the handoff trust boundary.
One design point I would like to confirm before implementation is how the shared Claude parser should handle lineage when the handoff is restricted to a bounded tail window. If this direction looks reasonable, I can start with the catalog/parity-test seam and submit the work incrementally.
Closing: this targets the TypeScript implementation on main, which is superseded by rust-preview (#6366). If it still applies to rust-preview, please open a new issue against it.
Activity
CxHsin commentedon Aug 23, 2026
Hi, I would like to take #3625.
I reviewed the current ForeignSession handoff and ExternalSession import paths. They independently perform source discovery, transcript selection, metadata extraction, bounded reading, and source-specific parsing, which has already caused their Codex and Claude behavior to diverge.
My proposed approach is:
main, while coordinating with feat(core,storage,cli): evidence pointers and staleness flags for foreign session handoff #1512 and fix(storage): import Codex item_completed messages #3520.event_msgpresentation authority andresponse_itemtool authority, including the v0.149item_completedcases from fix(storage): import Codex item_completed messages #3520.externalOrigin, atomic persistence, and replay.I will not introduce a generic
ExternalMessagemodel or derive the handoff from importedStoredMessage[], since that would weaken the handoff trust boundary.One design point I would like to confirm before implementation is how the shared Claude parser should handle lineage when the handoff is restricted to a bounded tail window. If this direction looks reasonable, I can start with the catalog/parity-test seam and submit the work incrementally.
Astro-Han commentedon Aug 23, 2026
Assigned! btw the Codex session import failed because codex changed their session structure. Make sure to test the Codex session import route! @CxHsin
refactor(storage): consolidate external session source parsing
Astro-Han commentedon Nov 5, 2026
Closing: this targets the TypeScript implementation on
main, which is superseded byrust-preview(#6366). If it still applies torust-preview, please open a new issue against it.