Skip to content

chore(sdk/typescript): kcode- tmpdir prefixes in launch and live-options tests - #344

Merged
KooshaPari merged 3 commits into
masterfrom
ci-repair/kcode-tssdk-bridge-msg
Nov 24, 2026
Merged

KooshaPari merged 3 commits into
masterfrom
ci-repair/kcode-tssdk-bridge-msg

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

User description

Part of #159

What

Four temporary-directory prefixes in the TypeScript SDK tests still carried the upstream jcode- name. Renamed to kcode- 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-home

Consumed only by fs.mkdtempSync(path.join(os.tmpdir(), prefix)) and one path.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:

 sdk/typescript/test/launch.test.ts   | 4 ++--
 sdk/typescript/test/live-options.mjs | 4 ++--

Merge conflict count against master: 0.

Validation

  • Merge against origin/master is clean; the diff above is the entire residual.
  • NOT_RUN: the SDK test suite itself is not executed here; the merge changes only string literals passed to 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 run npm ci --ignore-scripts && npm test in sdk/typescript on 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

  • Renamed temporary test paths from jcode- to kcode- so they pass the SDK’s path checks

Impact

✅ 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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.

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
…options tests

tx-agent: jcode
tx-validated: none
tx-scope: kcode-tssdk-bridge-msg
tx-lane: jcode:session_iwazaru_1795472450499_bcf77f2c366985f8
Copilot AI balanced review requested due to automatic review settings November 24, 2026 00:37
@codeant-ai

codeant-ai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #a6937 Reviewed your PR 3e91e9b Nov 24, 2026 · 00:37 00:40

@codeant-ai

codeant-ai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 94867702-76fb-45f5-b093-9fea9a124bd7
Commits

Reviewing files that changed from the base of the PR and between c129e15 and 3e91e9b.

Files selected for processing: 2

  • sdk/typescript/test/launch.test.ts
  • sdk/typescript/test/live-options.mjs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Nov 24, 2026
@sonarqubecloud

Copy link
Copy Markdown

// 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");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

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
👍 | 👎

@codeant-ai

codeant-ai Bot commented Nov 24, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt PR Risk

🟡  Medium Risk

  • The PR needs attention before merging.
  • Concurrent runs of the live-options test share and reset the same temporary home, which can disrupt persisted-session checks.

Assessed commit: 3e91e9b145aa

@kilo-code-bot

kilo-code-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • sdk/typescript/test/client.test.ts - 3 changes: 2 tempdir prefix renames + 1 assertion regex update
  • sdk/typescript/test/launch.test.ts - 8 tempdir prefix renames
  • sdk/typescript/test/live-options.mjs - 2 tempdir prefix renames
  • sdk/typescript/test/mock-harness.ts - 1 tempdir prefix rename

Reviewed by free · Input: 48.3K · Output: 17.3K · Cached: 890.4K

@KooshaPari
KooshaPari merged commit 9bfb1cd into master Nov 24, 2026
23 checks passed
@KooshaPari
KooshaPari deleted the ci-repair/kcode-tssdk-bridge-msg branch November 24, 2026 01:16
@KooshaPari
KooshaPari restored the ci-repair/kcode-tssdk-bridge-msg branch November 25, 2026 11:37
@KooshaPari
KooshaPari deleted the ci-repair/kcode-tssdk-bridge-msg branch November 27, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants