Skip to content

fix(codex): count user fork turns after replay - #719

Merged
junhoyeo merged 2 commits into
junhoyeo:mainfrom
wuruoye:main
Jun 17, 2026
Merged

fix(codex): count user fork turns after replay#719
junhoyeo merged 2 commits into
junhoyeo:mainfrom
wuruoye:main

Conversation

@wuruoye

@wuruoye wuruoye commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix Codex user fork sessions being undercounted when the child session repeats session_meta after its own turn_context.
  • Keep fork parent replay filtering intact while preventing repeated active child metadata from resetting replay state.
  • Bump the source message cache schema so previously cached empty Codex fork parses are invalidated.

Verification

  • cargo test -p tokscale-core codex
  • cargo test -p tokscale-core
  • Verified local Codex fork sessions appear in models --group-by session,model.

Summary by cubic

Fix Codex fork replay parsing so user-fork sessions count the child’s own turn after a parent replay, even when the child re-emits session_meta. Bumps the source message cache schema to invalidate stale empty Codex entries.

  • Bug Fixes

    • Ignore repeated child session_meta after the child turn_context so replay state isn’t reset.
    • Keep parent replay filtering intact and add tests for user-fork scenarios across parser and aggregate paths.
  • Migration

    • Cache schema is now 20 in tokscale-core; older Codex cache entries will reparse automatically.

Written for commit 5d170a8. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tokscale Ready Ready Preview, Comment Jun 17, 2026 6:35pm

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

Keep repeated child session metadata from resetting fork replay state after the child turn has started.

Add parser and aggregate-path coverage for Codex user fork sessions, and bump the source message cache schema so stale empty entries are invalidated.
# Conflicts:
#	crates/tokscale-core/src/message_cache.rs
@junhoyeo
junhoyeo merged commit 3a68cf5 into junhoyeo:main Jun 17, 2026
3 checks passed
pinion05 added a commit to pinion05/tokscale that referenced this pull request Jun 23, 2026
Keep repeated child session metadata from resetting fork replay state after the child turn has started.

Add parser and aggregate-path coverage for Codex user fork sessions, and bump the source message cache schema so stale empty entries are invalidated.

Co-authored-by: Junho Yeo <i@junho.io>
t1000040 pushed a commit to tmobi-internal/tokscale that referenced this pull request Jun 30, 2026
Keep repeated child session metadata from resetting fork replay state after the child turn has started.

Add parser and aggregate-path coverage for Codex user fork sessions, and bump the source message cache schema so stale empty entries are invalidated.

Co-authored-by: Junho Yeo <i@junho.io>
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