Skip to content

feat: import Codex sessions into LiveAgent - #300

Draft
FlowerRealm wants to merge 10 commits into
Stack-Cairn:mainfrom
FlowerRealm:feat/import-codex-conversations
Draft

feat: import Codex sessions into LiveAgent#300
FlowerRealm wants to merge 10 commits into
Stack-Cairn:mainfrom
FlowerRealm:feat/import-codex-conversations

Conversation

@FlowerRealm

Copy link
Copy Markdown

Summary

Adds a new Conversations settings section that imports Codex (~/.codex/sessions) conversations into LiveAgent, skipping ones already present, and exposes a chat_history_import_codex command to the frontend.

Changes

  • Backend (crates/agent-gui/src-tauri):
    • New codex_import.rs module implementing the import + chat_history_import_codex command
    • Registered the command in lib.rs and wired into chat_history/mod.rs
    • Tests covering the import path in chat_history/tests.rs
  • Frontend (crates/agent-gui/src):
    • New ConversationsSection.tsx settings panel
    • Nav entry + SectionId ("conversations") in SettingsPage.tsx / types.ts
    • importCodexChatHistory() helper in chatHistory.ts
    • i18n strings (zh + en) in i18n/config.ts

Notes

  • Draft PR — opening for review of the import approach before finalizing.
  • Minor incidental cleanup in getSaveIndicator (folds saved/idle into the default branch; behavior unchanged).

Testing

  • cargo test for the new chat_history import path
  • Manual: open Settings → Conversations → import, observe scanned/imported counts

Add a settings entry "Conversations" that scans ~/.codex/sessions and
imports Codex conversations that are not already present in LiveAgent,
exposing chat_history_import_codex to the frontend.

- Backend: new codex_import module wiring an import command
- Frontend: ConversationsSection + nav entry + i18n (zh/en)
- Tests: cover the Codex import path
@FlowerRealm

Copy link
Copy Markdown
Author

代码vibe的, 如有码风等要求劳烦自己改一下

Hardcoded fixtures that mirror the implementation they guard add no
value——delete them.
@FlowerRealm FlowerRealm changed the title feat(chat-history): import Codex sessions into LiveAgent feat: import Codex sessions into LiveAgent Jul 28, 2026
Split the one-shot chat_history_import_codex command into a read-only
scan (chat_history_scan_codex) returning per-session alreadyImported
flags, and an import command that accepts the selected session ids.

Add a two-pane CodexImportDialog (workspaces left, sessions right).
New sessions are selected by default; already-imported sessions are
greyed out and unchecked. Sessions under ~/Documents/Codex already
collapse into the default-project workspace via codex_import_cwd.
The ~/Documents/Codex remapping was platform-dependent and fragile.
Sessions are already read from the stable ~/.codex/sessions path; the
cwd field inside each session now passes through unmodified.
@FlowerRealm
FlowerRealm marked this pull request as ready for review July 28, 2026 07:47
Replace forEach callbacks returning values with for...of loops
to fix useIterableCallbackReturn errors. Biome auto-formatting.
@FlowerRealm

Copy link
Copy Markdown
Author
image image image image image

@FlowerRealm

Copy link
Copy Markdown
Author

依然缺失windows下测评

@FlowerRealm

Copy link
Copy Markdown
Author

等一下找到人测了

@su-fen

su-fen commented Jul 28, 2026

Copy link
Copy Markdown
Member

晚点我在windows下测一下

@FlowerRealm

Copy link
Copy Markdown
Author

看看UI有没有问题

Map Codex temporary Documents directories to LiveAgent's default project
so imported conversations do not retain invalid working directories.
@FlowerRealm
FlowerRealm marked this pull request as draft July 29, 2026 01:58
@FlowerRealm
FlowerRealm marked this pull request as ready for review July 29, 2026 02:01
@FlowerRealm

Copy link
Copy Markdown
Author

windows测试过了吗 @su-fen

@FlowerRealm

Copy link
Copy Markdown
Author

现在有个问题是Codex App有不在任何工作区的临时会话的判定
但是文档都翻烂了也没看到标识
只能用~/Documents/codex来判断
但是这样会被多平台搞炸

@FlowerRealm

Copy link
Copy Markdown
Author

算了先把claude部分一起写了

@FlowerRealm
FlowerRealm marked this pull request as draft July 29, 2026 05:24
@FlowerRealm
FlowerRealm marked this pull request as ready for review July 29, 2026 07:34
@FlowerRealm

Copy link
Copy Markdown
Author

已完成windows上测试, 请求合并

@FlowerRealm

Copy link
Copy Markdown
Author

@su-fen

@FlowerRealm
FlowerRealm marked this pull request as draft July 29, 2026 08:00
@FlowerRealm

Copy link
Copy Markdown
Author

撤回我的合并请求

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