Skip to content

fix(discover): report Windows sessions instead of always zero - #3438

Open
make0uthill wants to merge 1 commit into
rtk-ai:developfrom
make0uthill:fix/windows-discover-finds-nothing
Open

fix(discover): report Windows sessions instead of always zero#3438
make0uthill wants to merge 1 commit into
rtk-ai:developfrom
make0uthill:fix/windows-discover-finds-nothing

Conversation

@make0uthill

Copy link
Copy Markdown

Summary

On Windows, rtk discover and rtk session report 0 commands even for projects with a long transcript history. Two independent causes in the Claude transcript provider, both fixed here:

  • encode_project_path left the drive-letter colon intact, producing D:-Code-... while Claude Code writes D--Code-... on disk. : is not a legal character in a Windows directory name, so the slug it creates cannot contain one — every lookup missed.
  • The tool_use scan matched only "Bash" blocks. On Windows the agent issues most commands through the PowerShell tool, so the bulk of the transcript was skipped even once the directory was found.

test_encode_project_path_windows asserted the buggy slug (C:-Users-foo-bar), so it is updated to the value that actually appears on disk.

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test — 2554 passed, 0 failed
  • Manual testing: on a real project directory rtk discover went from 0 sessions to 278 commands across 10 sessions, with the reported rewrites matching what the hook actually does.

Targets develop as required.

On Windows `rtk discover` and `rtk session` reported 0 commands even for
projects with a long transcript history. Two independent causes, both in
the Claude transcript provider:

1. `encode_project_path` left the drive-letter colon intact, producing
   `D:-Code-...` while Claude Code writes `D--Code-...` on disk. `:` is
   not a legal character in a Windows directory name, so the slug it
   creates cannot contain one. Every lookup missed.

2. The tool_use scan matched only `"Bash"` blocks. On Windows the agent
   issues most commands through the `PowerShell` tool, so the bulk of the
   transcript was skipped even once the directory was found.

`test_encode_project_path_windows` asserted the buggy slug, so it is
updated to the value that actually appears on disk.

Verified against a real transcript directory: after the fix `rtk discover`
reports 278 commands across 10 sessions for a project that previously
reported 0.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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