fix(scanner): include OpenClaw auto-archived subagent transcripts in scan#342
Merged
Merged
Conversation
…scan OpenClaw renames completed subagent transcripts from <uuid>.jsonl to <uuid>.jsonl.deleted.<timestamp>. These files were missed by the *.jsonl glob. Add a *.jsonl* pattern for OpenClaw and fix session ID extraction to handle the suffixed filenames. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Contributor
|
@baanish is attempting to deploy a commit to the Inevitable Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
junhoyeo
approved these changes
Mar 19, 2026
junhoyeo
left a comment
Owner
There was a problem hiding this comment.
LGTM — clean, well-scoped fix. Pattern matching is properly constrained to OpenClaw only, session ID parsing fix is correct. Ship it.
junhoyeo
added a commit
that referenced
this pull request
Mar 24, 2026
The #342 audit found the scanner and parser implementation working, but not protected by regression coverage for auto-archived transcript filenames. Add focused tests for `.jsonl.deleted.<timestamp>` files so OpenClaw subagent archives stay scanned and preserve stable session IDs. Constraint: Worker-2 scope is limited to the OpenClaw scanner audit for merge #342 Rejected: Broader scanner/parser refactor | audit only needed targeted regression coverage Confidence: high Scope-risk: narrow Directive: Keep archived OpenClaw filenames covered whenever scan patterns or session-id parsing change Tested: rustfmt --edition 2021 --check crates/tokscale-core/src/scanner.rs crates/tokscale-core/src/sessions/openclaw.rs Tested: cargo check -p tokscale-core Tested: cargo test -p tokscale-core openclaw -- --nocapture Tested: cargo test -p tokscale-core test_scan_all_clients_openclaw -- --nocapture Not-tested: cargo clippy -p tokscale-core --lib --tests -- -D warnings (fails on pre-existing out-of-scope issues in pricing/lookup.rs, sessions/kilo.rs, and message_cache.rs)
crhan
pushed a commit
to crhan/tokscale
that referenced
this pull request
Mar 26, 2026
The junhoyeo#342 audit found the scanner and parser implementation working, but not protected by regression coverage for auto-archived transcript filenames. Add focused tests for `.jsonl.deleted.<timestamp>` files so OpenClaw subagent archives stay scanned and preserve stable session IDs. Constraint: Worker-2 scope is limited to the OpenClaw scanner audit for merge junhoyeo#342 Rejected: Broader scanner/parser refactor | audit only needed targeted regression coverage Confidence: high Scope-risk: narrow Directive: Keep archived OpenClaw filenames covered whenever scan patterns or session-id parsing change Tested: rustfmt --edition 2021 --check crates/tokscale-core/src/scanner.rs crates/tokscale-core/src/sessions/openclaw.rs Tested: cargo check -p tokscale-core Tested: cargo test -p tokscale-core openclaw -- --nocapture Tested: cargo test -p tokscale-core test_scan_all_clients_openclaw -- --nocapture Not-tested: cargo clippy -p tokscale-core --lib --tests -- -D warnings (fails on pre-existing out-of-scope issues in pricing/lookup.rs, sessions/kilo.rs, and message_cache.rs)
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
<uuid>.jsonl.deleted.<ts>) via a dedicated*.jsonl*scan patternWhy
OpenClaw renames completed subagent transcripts from
<uuid>.jsonlto<uuid>.jsonl.deleted.<timestamp>, which falls outside the*.jsonlglob. These files stay on disk with full usage data but are invisible to tokscale's scanner.Rather than broadening the shared
*.jsonlarm (which would affect every JSONL-based client), this adds an OpenClaw-specific*.jsonl*pattern.Diff scope
*.jsonl*pattern arm inscan_directorythat matches both.jsonland.jsonl.deleted.**.jsonl*inclients.rsparse_openclaw_transcriptto usesplit_once(".jsonl")instead offile_stem(), which incorrectly extractsuuid.jsonl.deletedas the session ID for archived transcriptsTest proof
cargo fmt --all --checkcargo test -p tokscale-core377 passed, 0 failed, 1 ignoredcargo clippy -p tokscale-core --all-features -- -D warningsVerification-pack proof
Not applicable — scanner behavior change only.
Migration notes
Not applicable — no schema or data migration.
Rollback plan
git revert <merge_commit_sha>git revert <squash_commit_sha>Known residual risks
.deleted, thecontains(".jsonl.deleted.")check would need updatingRelated
Summary by cubic
Include OpenClaw’s auto-archived subagent transcripts in scans by matching
<uuid>.jsonl.deleted.<ts>files. Adds an OpenClaw-specific*.jsonl*pattern and fixes session ID parsing to attribute archived transcripts correctly.*.jsonl*arm to match.jsonland.jsonl.deleted.*, used only for OpenClaw.*.jsonl*under.openclaw/agents.split_once(".jsonl")inparse_openclaw_transcriptto extract the UUID instead offile_stem().Written for commit 6795d0d. Summary will update on new commits.