Skip to content

feat: support Host-scoped Claude Session import - #207

Merged
BytePioneer-AI merged 1 commit into
BytePioneer-AI:mainfrom
SuperGoodGame:fix/claude-session-import
Oct 28, 2026
Merged

BytePioneer-AI merged 1 commit into
BytePioneer-AI:mainfrom
SuperGoodGame:fix/claude-session-import

Conversation

@SuperGoodGame

Copy link
Copy Markdown
Contributor

Purpose

Add Claude Code to the generic Session Import flow and scope discovery, import, and navigation to the currently selected Composer Host. This allows native Claude Sessions stored on local or remote Hosts to be mapped and resumed without copying their Transcript.

It also fixes two issues found during a real Linux SSH deployment:

  • Claude SDK metadata can retain an earlier cwd after the Session moves into a nested repository, leaving the imported Thread outside the matching sidebar project.
  • Desktop catalog requests use modelProviders: [] as an unfiltered query, while older official app-server builds reject that no-op filter and make aggregated thread/list fail.

Changes

  • Discover and freshly resolve Claude Sessions through the Claude Agent SDK, with canonical project paths, bounded titles, stable native identity, and conservative unknown activity state.
  • Use the latest existing cwd recorded in the native Transcript when resolving an import, and refresh an existing mapping's cwd on an idempotent re-import.
  • Forward Session Import through the macOS Aqua Broker with bounded pagination; Linux SSH Hosts run the same capability directly.
  • Route the Settings page through the active Composer Host and capture that Host for list, import, and imported-Thread navigation.
  • Normalize the Desktop's empty modelProviders filter before querying older official app-server runtimes so catalog aggregation and sidebar grouping continue to work.
  • Update the public specification and local/remote Host documentation.

Safety and compatibility

  • Import remains mapping-only: it does not copy or migrate Transcript content and does not send a user Turn.
  • Transcript messages are inspected only inside the target Claude Adapter to recover the authoritative cwd; content is not projected through Host or Renderer RPC.
  • Sessions not opened by the current Adapter remain running: null; users are instructed to close native clients before importing.
  • Empty modelProviders normalization affects only the no-op filter; non-empty filters remain unchanged.

Validation

  • npm run lint
  • npm run typecheck
  • npm run build:typescript
  • npm run build:renderer
  • npx --no-install openspec validate --all --strict
  • Focused Vitest: 9 files / 302 tests passed (the Broker suite was rerun outside the filesystem sandbox so it could create its Unix socket).
  • npm run format:check: Prettier passed; the command then stopped because Cargo is not installed locally. This PR does not change Rust files.
  • Real H200 SSH smoke: discovered and imported a native Claude Session, resolved its final /home/jovyan/dev/verl/verl cwd, returned it through the exact Desktop catalog query, refreshed the local catalog, and displayed it under the matching remote sidebar project. User verification passed.

Follow-up to #144.
Refs #72 and #87.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 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-08T06:38:37.527169Z de795b9 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.

@github-actions github-actions Bot added the enhancement New feature or request label Sep 11, 2026
Repository owner deleted a comment from github-actions Bot Sep 11, 2026
@BytePioneer-AI BytePioneer-AI added 功能:会话导入 发现并映射已有原生 Session 到 Host Thread 类型:功能新增 PR 新增或扩展能力;标签描述变更意图,不表示功能已发布 范围:桌面界面 Desktop Controller、Renderer、Composer 和设置界面 范围:远程连接 SSH、Remote Host 连接及本地/远程路由兼容 范围:适配器 各 Harness 的原生协议、能力、事件和会话适配实现 适配器:Claude Code 涉及 Claude Code Harness 适配或对应产品接入;不表示已经完整验收 labels Sep 30, 2026
@BytePioneer-AI BytePioneer-AI added Claude Code 会话导入 PR 具体作用:Claude Code 会话导入 and removed 功能:会话导入 发现并映射已有原生 Session 到 Host Thread 类型:功能新增 PR 新增或扩展能力;标签描述变更意图,不表示功能已发布 范围:桌面界面 Desktop Controller、Renderer、Composer 和设置界面 范围:远程连接 SSH、Remote Host 连接及本地/远程路由兼容 范围:适配器 各 Harness 的原生协议、能力、事件和会话适配实现 适配器:Claude Code 涉及 Claude Code Harness 适配或对应产品接入;不表示已经完整验收 labels Oct 2, 2026
@BytePioneer-AI
BytePioneer-AI merged commit 67a8ec4 into BytePioneer-AI:main Oct 28, 2026
1 check passed
zxd-666 added a commit to zxd-666/codex-host that referenced this pull request Oct 29, 2026
codexhost v0.15.0

## What's New

Import native Sessions from a selected Host, answer multi-select questions, and use Grok's native questions. This release also adds Antigravity usage statistics and improves conversation reliability across Claude Code, Pi, Windows, and Codex Desktop.
支持从所选 Host 导入原生 Session、回答多选问题,并接入 Grok 原生提问。本版还新增 Antigravity 用量统计,改进 Claude Code、Pi、Windows 和 Codex Desktop 的会话可靠性。

### Features

- Select a local or remote Host for Session import, keeping import and opening on the selected machine; support macOS Broker-backed imports for Claude Code, Cursor CLI, CodeBuddy, and WorkBuddy (BytePioneer-AI#207)
- Answer external Harness multi-select questions in a shared card, with accompanying single-choice and text fields and drafts retained while switching chats (BytePioneer-AI#625)
- Answer Grok's native single-choice, multi-select, and text questions, with cancellation and native withdrawal support (BytePioneer-AI#625)
- Read Antigravity's native historical request and Token usage, including Sessions created outside codexhost; model and cost information remain unavailable when absent from native records (BytePioneer-AI#588)

### Fixes

- Steer Claude Code continuations within the same Turn without stopping background Subagents, and keep accepted instructions attached to that Turn (BytePioneer-AI#617)
- Release Claude Code Turns after refused Subagent messages, and allow Fork and message-edit recovery after entering a native worktree (BytePioneer-AI#626, BytePioneer-AI#629)
- Improve Pi's large-history RPC performance and ignore late replies to expired read-only queries without faulting the Session (BytePioneer-AI#607)
- Recover stale Windows Mapping Store locks when a PID has been reused by another process (BytePioneer-AI#627)
- Keep Antigravity questions working across Turns, preserve the project working directory, and bound process cleanup waits (BytePioneer-AI#586)
- Keep Antigravity Conversation totals separate from current context usage (BytePioneer-AI#587)
- Disable background self-update by default for Host-started Antigravity processes on Windows and macOS, while retaining explicit updates (BytePioneer-AI#585)
- Explain unavailable ZCode plans or quotas without asking an already signed-in account to log in again (BytePioneer-AI#621)
- Compact Composer controls in narrow layouts and keep native question and approval inputs separate from chat controls (BytePioneer-AI#624, BytePioneer-AI#625)
- Support Codex Desktop 26.1023 native language settings (BytePioneer-AI#636)
- Fix availability checks routed through the Harness Broker

### 新功能

- 会话导入支持选择本地或远程 Host,导入和打开始终使用所选机器;macOS 上通过 Broker 托管的 Claude Code、Cursor CLI、CodeBuddy 和 WorkBuddy 支持导入 (BytePioneer-AI#207)
- 外部 Harness 多选问题使用公共卡片,可与单选、文本字段一起回答,切换聊天时保留未提交草稿 (BytePioneer-AI#625)
- 接入 Grok 原生单选、多选和文本提问,支持取消及原生问题撤回 (BytePioneer-AI#625)
- 从 Antigravity 原生历史记录统计请求和 Token,包括未经 codexhost 创建的 Session;原生记录缺少模型信息时显示为未知模型且不计价 (BytePioneer-AI#588)

### 修复

- Claude Code 后台 Subagent 运行期间支持同一 Turn 内继续插入指令,不必停止后台任务;已接受的指令保持归属当前 Turn (BytePioneer-AI#617)
- Claude Code 子 Agent 消息被拒绝后正确释放 Turn;进入原生 worktree 后仍可 Fork 和进行消息编辑恢复 (BytePioneer-AI#626, BytePioneer-AI#629)
- 改善 Pi 大历史 RPC 处理性能;只读查询超时后的迟到回复不再导致 Session 故障 (BytePioneer-AI#607)
- Windows 上 PID 被其他进程复用时,可以回收残留的 Mapping Store 锁 (BytePioneer-AI#627)
- 修复 Antigravity 多轮提问失效,明确项目工作目录,并限制进程清理等待时间 (BytePioneer-AI#586)
- 避免把 Antigravity 整段 Conversation 的累计用量误当作当前上下文占用 (BytePioneer-AI#587)
- Windows 和 macOS 上由 Host 启动的 Antigravity 进程默认关闭后台自更新,保留显式更新操作 (BytePioneer-AI#585)
- ZCode 已登录但套餐或额度不可用时显示正确原因,不再要求重复登录 (BytePioneer-AI#621)
- 窄布局下压缩 Composer 控件,并避免聊天控件干扰原生提问与审批输入 (BytePioneer-AI#624, BytePioneer-AI#625)
- 适配 Codex Desktop 26.1023 的原生语言设置 (BytePioneer-AI#636)
- 修复通过 Harness Broker 路由的可用性检查

### Breaking Changes

- Language overrides require Codex Desktop's native settings service. Desktops exposing only the legacy locale RPC are no longer supported for language overrides; reading can fall back to the browser language, but changing the override requires the native service (BytePioneer-AI#636)

### 破坏性变更

- 语言覆盖设置需要 Codex Desktop 原生 settings 服务。仅提供旧 locale RPC 的 Desktop 不再支持语言覆盖;读取时可以降级使用浏览器语言,但修改覆盖值需要原生服务 (BytePioneer-AI#636)

## Installation

### npm

```bash
npm install -g @codexhost/cli
codexhost
```

For remote Session import and multi-select questions, update the Desktop installation and the relevant remote Hosts and Brokers together.

### Installer

Download the installer matching your OS and CPU architecture from this release's assets.

### macOS Gatekeeper

After installing on macOS, if codexhost shows "Apple cannot verify this app" when you open it for the first time, run the following command in Terminal and reopen codexhost:

```bash
xattr -dr com.apple.quarantine /Applications/codexhost.app
```

## Contributors

Thanks to everyone who contributed to this release:

- @BeiLuoqu (BytePioneer-AI#585, BytePioneer-AI#586, BytePioneer-AI#587, BytePioneer-AI#588)
- @bwndlct (BytePioneer-AI#617)
- @BytePioneer-AI (BytePioneer-AI#207, BytePioneer-AI#625, BytePioneer-AI#626, BytePioneer-AI#627, BytePioneer-AI#629, BytePioneer-AI#636)
- @cy2s (BytePioneer-AI#624)
- @karlorz (BytePioneer-AI#625)
- @kunkun9527 (BytePioneer-AI#607)
- @SuperGoodGame (BytePioneer-AI#207)
- @ump45nose (BytePioneer-AI#621)

# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	package-lock.json
#	package.json
#	packages/renderer-extension/src/renderer-binding-probe.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Claude Code 会话导入 PR 具体作用:Claude Code 会话导入 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants