Skip to content

fix(cli): restore interactive terminal input for workspaces - #12935

Merged
marius-kilocode merged 2 commits into
mainfrom
fix-cli-interactive-terminal
Aug 6, 2026
Merged

fix(cli): restore interactive terminal input for workspaces#12935
marius-kilocode merged 2 commits into
mainfrom
fix-cli-interactive-terminal

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

Interactive terminal control requests did not include the active workspace. In multi-workspace CLI sessions, the terminal could render output while input, polling, resize, and close requests were routed without the session context, so user-driven commands could not be completed reliably.

This forwards the session workspace through the standard TUI and direct interactive CLI runtime, adds focused coverage for both paths, and makes the root bun dev command identify itself as the CLI even when launched from a VS Code-inherited environment. The extension continues to keep interactive_terminal unavailable until it has a dedicated user-input surface.

Comment thread packages/opencode/src/kilocode/cli/cmd/run-terminal.ts Outdated
Comment thread package.json
@kilo-code-bot

kilo-code-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
package.json 9 Inline KILO_CLIENT=cli env assignment may not be portable to Windows dev environments
Files Reviewed (3 files)
  • package.json - 1 issue
  • packages/opencode/src/kilocode/cli/cmd/run-terminal.ts - 0 issues
  • packages/opencode/test/kilocode/cli/cmd/run-terminal.test.ts - 0 issues

Incremental review of the new commits: the previous warning is resolved — a failed workspace lookup now throws on result.error and invalidates the cache (state.id/state.workspace reset), so the next terminal request retries the lookup instead of silently routing without a workspace for the rest of the session. The new test drives the real SDK through a 503-then-200 fetch stub and asserts both the retry and the workspace-less first request, exercising the implementation rather than a mock. No memory-leak concerns (cache remains bounded to one entry per session). No new issues found; the remaining suggestion on package.json is unchanged from the previous review.

Fix these issues in Kilo Cloud

Previous Review Summary (commit 3917ed1)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 3917ed1)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/kilocode/cli/cmd/run-terminal.ts 23 A failed session.get is cached as undefined permanently, silently disabling workspace routing for the rest of the session

SUGGESTION

File Line Issue
package.json 9 Inline KILO_CLIENT=cli env assignment may not be portable to Windows dev environments
Files Reviewed (7 files)
  • .changeset/fix-interactive-terminal-input.md - 0 issues
  • package.json - 1 issue
  • packages/opencode/src/cli/cmd/run/runtime.ts - 0 issues
  • packages/opencode/src/kilocode/cli/cmd/run-terminal.ts - 1 issue
  • packages/opencode/test/kilocode/cli/cmd/run-terminal.test.ts - 0 issues
  • packages/tui/src/routes/session/terminal.tsx - 0 issues
  • packages/tui/test/kilocode/interactive-terminal.test.tsx - 0 issues

The change is well-scoped: the Kilo-specific logic is cleanly extracted into packages/opencode/src/kilocode/cli/cmd/run-terminal.ts behind kilocode_change markers, the SDK already supports the workspace query param on all interactive-terminal endpoints, both the TUI and direct CLI runtime paths are covered by focused tests that exercise the real HTTP boundary, and no resource/memory leaks were introduced (the cache is bounded to one entry per session; no new subscriptions or handles). The two findings above are the only concerns.

Fix these issues in Kilo Cloud


Reviewed by kimi-k3 · Input: 42.3K · Output: 7K · Cached: 204.8K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 157afe4 into main Aug 6, 2026
31 checks passed
@marius-kilocode
marius-kilocode deleted the fix-cli-interactive-terminal branch August 6, 2026 11:36
LudwigSolutionsAI pushed a commit to LudwigSolutionsAI/kilocode that referenced this pull request Aug 6, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…erminal

fix(cli): restore interactive terminal input for workspaces
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