Skip to content

fix: code workspace path escape errors - #2283

Open
xianjianlf2 wants to merge 3 commits into
MoonshotAI:mainfrom
xianjianlf2:markxian/fix-workspace-path-escape
Open

fix: code workspace path escape errors#2283
xianjianlf2 wants to merge 3 commits into
MoonshotAI:mainfrom
xianjianlf2:markxian/fix-workspace-path-escape

Conversation

@xianjianlf2

@xianjianlf2 xianjianlf2 commented Jul 28, 2026

Copy link
Copy Markdown

Related Issue

No linked issue.

Problem

Path escapes from the workspace root currently bubble as generic errors instead of a stable workspace-specific code, which makes terminal reporting inconsistent.

What changed

Added a coded workspace-path-escape error, throw it from the workspace context service, map it to FS_PATH_ESCAPES_SESSION in kap-server, and cover the path with tests. Added a changeset for the release note.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bd03d61

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…e-path-escape

# Conflicts:
#	packages/agent-core-v2/src/session/workspaceContext/workspaceContextService.ts
@xianjianlf2

Copy link
Copy Markdown
Author

Resolved conflicts with latest main and pushed head 4c4459f. The resolution keeps current main's shared FS_PATH_ESCAPES error domain and maps terminal cwd escapes to FS_PATH_ESCAPES_SESSION. Local validation under Node 24.18.0: pnpm install --frozen-lockfile; pnpm --dir packages/agent-core-v2 test test/session/workspaceContext/workspaceContextService.test.ts (3 passed); pnpm --dir packages/kap-server test test/terminals.test.ts (4 passed).

…ace-path-escape

# Conflicts:
#	packages/agent-core-v2/src/session/workspaceContext/workspaceContextService.ts
#	packages/kap-server/src/routes/terminals.ts
@xianjianlf2

Copy link
Copy Markdown
Author

Rebased/resolved conflicts against upstream main.

Validation:

  • pnpm exec vitest run packages/agent-core-v2/test/session/workspaceContext/workspaceContextService.test.ts packages/kap-server/test/terminals.test.ts (8 passed)
  • pnpm exec oxlint --type-aware packages/agent-core-v2/src/session/workspaceContext/workspaceContextService.ts packages/agent-core-v2/test/session/workspaceContext/workspaceContextService.test.ts packages/kap-server/src/routes/terminals.ts packages/kap-server/test/terminals.test.ts (0 errors; warnings only)
  • git diff --check

Current head: bd03d61

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.

1 participant