Repository navigation
chore(sdk/typescript): kcode- tmpdir prefixes in launch and live-options tests - #344
Conversation
The assertKcodePath guard in src/product.ts rejects any path segment matching /^jcode[.-].*|\.jcode.*$/iu, including the 'jcode-sdk-test-' prefixes baked into 13 test fixture temp dirs. After the kcode rebrand (PR #33), CI's 'Node 20 TypeScript SDK' job has been failing on these fixtures because the temp paths fall under the guard. This commit renames ONLY the test fixture prefixes to kcode-prefixed peers so the temp dirs no longer trip assertKcodePath. The guard regex, src/product.ts, and every other source file are untouched. Validation (with TMPDIR=/tmp on this branch): - before fix: 121 fail / 22 pass - after fix: 9 fail / 78 pass - 9 remaining failures are 4 unique tests that fail on master too: they assert against product text strings that already say 'kcode' (e.g. 'Start the bridge with `kcode api-bridge`'), not path-rename issues. They are pre-existing and out of scope for the fixture fix. Files changed: sdk/typescript/test/client.test.ts 2 prefixes sdk/typescript/test/launch.test.ts 8 prefixes/binary sdk/typescript/test/live-options.mjs 2 prefixes sdk/typescript/test/mock-harness.ts 1 prefix Files intentionally left alone: - src/** (no product source touched) - launch.test.ts:54 'not-a-jcode-instance-' segment - error-docs/schema-parity/parity.test.ts 'crates/jcode-harness-api' - product-isolation.test.ts .jcode/.sock strings (negative tests of the guard itself) - error.code === 'jcode_not_found' assertions (the product error code) Ref: docs/sessions/2026-10-18-resume-reland/00_SESSION_OVERVIEW.md tx-agent: jcode tx-validated: test tx-task: #135 tx-intent: Stop assertKcodePath rejecting jcode-prefixed test fixture temp dirs after the kcode rebrand
…test tx-agent: jcode tx-validated: test
…options tests tx-agent: jcode tx-validated: none tx-scope: kcode-tssdk-bridge-msg tx-lane: jcode:session_iwazaru_1795472450499_bcf77f2c366985f8
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 18 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
| // Every option the README documents should do what it says. | ||
| await step("jcodeHome keeps state at a fixed path across runs", async () => { | ||
| const home = path.join(os.tmpdir(), "jcode-sdk-option-home"); | ||
| const home = path.join(os.tmpdir(), "kcode-sdk-option-home"); |
There was a problem hiding this comment.
Suggestion: Concurrent test processes share this fixed home; one can remove or reset it while the other's daemon uses it, disrupting launches and persisted-session checks.
Assessment: 🟠 Major · 🔁 Occurrence: Rarely · 🏷️ Race condition
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** sdk/typescript/test/live-options.mjs
**Line:** 38:38
**Comment:**
*Race Condition: Concurrent test processes share this fixed home; one can remove or reset it while the other's daemon uses it, disrupting launches and persisted-session checks.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by free · Input: 48.3K · Output: 17.3K · Cached: 890.4K |



User description
Part of #159
What
Four temporary-directory prefixes in the TypeScript SDK tests still carried the upstream
jcode-name. Renamed tokcode-so test artefacts created on disk match the product's own name and are not mistaken for foreign state:sdk/typescript/test/launch.test.ts:jcode-precious-test-->kcode-precious-test-,jcode-daemon-race-test-->kcode-daemon-race-test-sdk/typescript/test/live-options.mjs:jcode-slow-<pid>.sh->kcode-slow-<pid>.sh,jcode-sdk-option-home->kcode-sdk-option-homeConsumed only by
fs.mkdtempSync(path.join(os.tmpdir(), prefix))and onepath.join; no assertion in these files keys on the name, so behaviour is unchanged.Evidence
After merging current master, residual against master is exactly 4 lines in 2 files:
Merge conflict count against master: 0.
Validation
origin/masteris clean; the diff above is the entire residual.mkdtempSync, and this PR does not claim the TypeScript gate is green. If you want the gate proven before merge, say so and I will runnpm ci --ignore-scripts && npm testinsdk/typescripton nixos first.tx-agent: jcode
tx-validated: none
tx-scope: sdk/typescript tests
tx-intent: land 4 lines of stale jcode- test-tempdir prefixes from the ci-repair branch (part of #159)
CodeAnt-AI Description
Fix TypeScript SDK tests that use rejected temporary paths
What Changed
jcode-tokcode-so they pass the SDK’s path checksImpact
✅ TypeScript SDK fixtures avoid path-validation failures✅ Tests can use temporary paths without triggering the product-name guard💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.