Repository navigation
fix(session): match CodeBuddy long project directory names - #1347
Conversation
The description documents sufficient build and real-CLI testing; no missing-testing finding applies. However, the claimed two passing E2E cases conflict with this fixture on a standard Linux temporary directory. Review was read-only; no PR code was run, built, or installed. |
- Match compressWorkspacePathName from the publisher's CodeBuddy 2.173.0 bundle: keep names up to 255 UTF-8 bytes, otherwise use a code-point-safe 180-byte prefix and the unsigned djb2 base36 hash of the entire normalized path. - Route existing CodeBuddy CLI and WorkBuddy session readers and writers through the corrected shared encoder, retaining short-path, space, punctuation and Windows-drive behavior. - Add publisher-evaluated fixed vectors for the byte boundary, multibyte and emoji truncation, distinct suffixes and Windows paths, plus real-CLI short/long migration and read-back coverage with segments that exceed the threshold independently of TMPDIR length. - Verify 10 encoder unit tests and both built-CLI migration E2E cases under native and short /tmp temporary roots, TypeScript and lint; update the bilingual session guide and troubleshooting skill data. Refs: Tencent#1221
2f83c93 to
01c30e3
Compare
|
No new findings in the specified diff.
Review was read-only; no PR code was run, built, or installed. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
@nateEc Thanks, approving. This closes the #1221 item on CodeBuddy's long project directory names.
We ported compressWorkspacePathName from CodeBuddy's 2.172.1 bundle (2.173.0 was too new to install here) and compared it with this PR's encoder on 4,000 generated paths, 1,334 of them over 255 bytes, multi-byte characters included. There were no mismatches. With the real CLI, a long-path session round-trips on this head, while the merge-base and main fail with ENAMETOOLONG. tsc, lint and the new tests pass.
Suggestions:
[P2 non-blocking]The troubleshooting paragraph sits under "Pull left an instruction file unchanged" rather than### WorkBuddy. Thedashboard.mdsentences (EN and zh-CN) describe internals a user can't act on. One actionable line, or none, would follow AGENTS.md's "change docs rarely".[P3 nit]Thefs.tscomment says it hashes "every original byte", but the code hashes the normalized string. The zh-CN text has a stray space after "。". The e2e long case repeats the djb2 loop where a literal would do, since the unit vectors already cover it.
CI review: it reported no new findings and accepted the testing record. We agree on the fix and the record. The two doc points above are the only additions. CI jobs pass at this head.
CodeBuddy compresses normalized workspace directory names above 255 UTF-8 bytes. TeamAI previously used the entire normalized path, so listing/reading missed native sessions and migration could fail with an overlong filename.
Match
compressWorkspacePathNamefrom the publisher's CodeBuddy 2.173.0 package: a code-point-safe 180-byte prefix plus-and the unsigned djb2 base36 hash of every normalized byte. Names at or below 255 bytes remain unchanged.Validation:
npx vitest run src/__tests__/buddy-windows-cwd.test.ts: 10 passed, covering 255/256 bytes, Unicode/emoji boundaries, distinct suffixes and Windows drive paths.npm run buildandnpx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/buddy-session-directories.test.ts: 2 passed through the built CLI: migrate a Claude transcript into short/long native CodeBuddy directories and read it back into Claude.TMPDIR=/tmp(252 bytes on macOS). The final fixture's segments alone now exceed 255 bytes. After rebuilding, the two CLI cases passed with retries disabled under both the native temp root andTMPDIR=/tmp(2 passed in each run); the 10 encoder unit cases, TypeScript and lint also passed on the final source.npx tsc --noEmit,npm run lint, andgit diff --check: passed.State review: both CodeBuddy CLI and WorkBuddy adapter directory lookup and session writes already call the shared encoder; no parallel path implementation or new storage format is introduced. The bilingual session guide and troubleshooting skill data are updated. Windows path seams were tested; native Windows and a live WorkBuddy desktop application were not available locally.
Broader regression:
npx vitest run --maxWorkers=6in a frozen integration worktree containing the five changes finished with 500 files passed, 12,285 tests passed, 36 skipped, 2 failed. Both failures are the pre-existingsubmodule-checkout.test.tsempty legacy hook-file cases; a clean83f6d1dbworktree independently reproduced 24 passed / the same 2 failed. This is an integration-suite record, not a claim that the baseline is fully green.Refs #1221. One independently reviewable defect from the issue; the audit/issue remains open for its other items.