Skip to content

feat(standalone-cli): add cursor and kiro standalone cli tabs - #519

Merged
heath-s merged 3 commits into
mainfrom
feat/standalone-cli
Sep 10, 2026
Merged

heath-s merged 3 commits into
mainfrom
feat/standalone-cli

Conversation

@heath-s

@heath-s heath-s commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Standalone CLI 탭에서 Cursor와 Kiro를 지원하고, 앞으로 새 AI provider가 추가될 때 대응하는 standalone CLI도 함께 추가되도록 강제 장치와 가이드를 넣었습니다.

Changes

Features

  • standalone-cli: Cursor / Kiro 탭 추가 (기존 Claude / Codex와 함께 4탭)
  • standalone-cli: Kiro 세션 재개 — kiro-cli chat --list-sessions --format json 폴링으로 세션 id를 발견하고 chat --resume-id <id>로 재개
  • standalone-cli: Cursor 세션 재개 — 신규 terminal:create-cursor-chat-id IPC로 chatId를 사전 발급해 --resume <chatId>로 실행. 발급 실패 시 id 없이 정상 시작(해당 대화만 재개 불가)

Refactors / Chores

  • host-service: CliSessionCreateSessionArgs.providerId와 IPC 스키마를 ManagedExecutionProviderId → ProviderId로 확장
  • host-service: provider별 launch spec을 신규 electron/host-service/cli-session-launch.ts로 분리하고 assertNever 적용. terminal-runtime.ts의 인라인 분기(Claude 외 전부 Codex 취급)를 제거
  • docs: 신규 docs/developer/adding-a-provider.md provider 추가 체크리스트. AGENTS.md와 the-provider-runtime-symmetry 스킬에 standalone CLI parity 가드레일 추가

새 ProviderId가 추가되면 STANDALONE_CLI_TAB_TITLE(Record<ProviderId, string>), launch spec의 assertNever, runtime options switch 3곳에서 typecheck가 깨집니다. 문서는 왜 깨졌는지를 안내하는 역할입니다.

Test Evidence

  • bun run typecheck 통과
  • 관련 집중 스위트 113 pass / 0 fail (cursor·kiro spawn 인자, Kiro discovery 및 claim 충돌, Cursor id 발급·폴백, 파서, IPC 스키마, popover/terminal)

Notes

  • 데스크톱 수동 스모크(4탭 실행 → 앱 재시작 후 재개 확인)는 아직 수행하지 않았습니다.
  • 워크스페이스 도크 CLI 패널의 provider 확장은 이번 범위 밖입니다.

Widen the CLI session contract from ManagedExecutionProviderId to
ProviderId so every provider can run as a standalone CLI tab, and
extract provider launch specs into cli-session-launch.ts with an
assertNever guard so adding a provider fails typecheck until the
standalone CLI wiring is updated.

Kiro sessions resume via `chat --resume-id`, discovered by polling
`kiro-cli chat --list-sessions --format json`. Cursor chat ids are
pre-issued through a new `terminal:create-cursor-chat-id` IPC and
passed as `--resume <chatId>`, falling back to a non-resumable
session when issuance fails.

Also adds docs/developer/adding-a-provider.md as the provider
addition checklist, plus AGENTS.md and provider-runtime-symmetry
skill guardrails pointing at it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@heath-s
heath-s requested a review from a team as a code owner September 10, 2026 00:32
@heath-s
heath-s requested review from dodonmountain and schang124 and removed request for a team September 10, 2026 00:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-10T00:39:58.931091Z b92f152 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@upwind-code-us

upwind-code-us Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Upwind Upwind Code Scan - ✅ Passed

0 newly introduced vulnerabilities · 0 resolved · 64 total in this PR vs main

Total breakdown: 🔶 13 High | 🟡 48 Medium | 🟢 3 Low

View full analysis in Upwind Console

Scan completed in 17s

Scan history (2 scans)
Commit Scanned at New Resolved Net
b92f152 2026-09-10 00:33 UTC 0 -7 -7
9dc844b < 2026-09-10 01:20 UTC 0 0 0

Last scanned: 9dc844b · 2026-09-10 01:20 UTC

@upwind-code-us

upwind-code-us Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Upwind Upwind IaC Scan - ✅ Passed

0 newly introduced misconfigurations · 0 resolved · 0 total in this PR vs main

View full analysis in Upwind Console →

Scan completed in 1s

Scan history (2 scans)
Commit Scanned at New Resolved Net
b92f152 2026-09-10 00:33 UTC 0 0 0
9dc844b < 2026-09-10 01:20 UTC 0 0 0

Last scanned: 9dc844b · 2026-09-10 01:20 UTC

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b92f152680

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +195 to +198
if (
summary.updatedAtMs <
args.startedAtMs - KIRO_SESSION_DISCOVERY_LOOKBACK_MS
) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Exclude pre-spawn Kiro sessions

When a Kiro tab is restarted shortly after activity, the immediate discovery scan accepts the just-closed session because its updatedAtMs can be up to 15 seconds before this PTY's start and its claim was released during close. If the new CLI has not created its own list entry yet, that old session becomes bestMatch and is persisted as the new PTY's native ID, so the next app launch resumes the conversation that Restart was supposed to discard. Snapshot and exclude preexisting IDs before spawning, or otherwise require evidence that the candidate belongs to this launch.

Useful? React with 👍 / 👎.

Comment on lines +223 to +227
const launchTab = await resolveStandaloneCliLaunchTab({
tab: args.tab,
folderPath: props.folderPath,
cursorBinaryPath,
createCursorChatId: window.api?.terminal?.createCursorChatId,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Cancel superseded Cursor prelaunch work

When the Cursor chat-ID request is still pending and the user presses Restart or changes the standalone folder, the session-manager effect is replaced but this asynchronous prelaunch continues. The stale completion can still create a PTY in the shared slot and return an ID that the manager records before checking its cancelled flag; it can then close a slot already adopted by the newer effect or repopulate the cleared store with the old folder's chat ID. Make this prelaunch generation-aware or abortable so superseded work is discarded before spawning.

AGENTS.md reference: AGENTS.md:L185-L185

Useful? React with 👍 / 👎.

terminal-runtime.ts grew past its max-lines ratchet after the Kiro
session discovery poller landed. Move both the Codex and Kiro discovery
pollers, their constants, and the native-id claim maps into
native-session-discovery.ts, which the runtime now instantiates with its
sessions map.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@heath-s
heath-s enabled auto-merge (squash) September 10, 2026 01:35
@heath-s

heath-s commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts in this pull request

# Conflicts:
#	docs/providers/provider-runtimes.md

Co-authored-by: heath-s <5037055+heath-s@users.noreply.github.com>
auto-merge was automatically disabled September 10, 2026 11:31

Head branch was pushed to by a user without write access

Copilot AI commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved by merging origin/main into this branch and fixing the conflict in docs/providers/provider-runtimes.md in commit a400d4d.

@heath-s
heath-s merged commit 4537085 into main Sep 10, 2026
4 checks passed
@heath-s
heath-s deleted the feat/standalone-cli branch September 10, 2026 11:32
@astyfx astyfx mentioned this pull request Sep 15, 2026
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.

3 participants