Skip to content

Feat/intake conversation resume#37

Merged
ignorejjj merged 2 commits into
RUC-NLPIR:mainfrom
xxy33:feat/intake-conversation-resume
Jun 25, 2026
Merged

Feat/intake conversation resume#37
ignorejjj merged 2 commits into
RUC-NLPIR:mainfrom
xxy33:feat/intake-conversation-resume

Conversation

@xxy33

@xxy33 xxy33 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary / 概述

The intake REPL (arbor with no subcommand) is a planning chat held before a
run is launched. It lived only in memory: quit before launching and it was gone,
so there was nothing to /resume — only launched runs under .arbor/sessions/
were ever persisted. This PR gives the conversation itself the same durability.

  • Auto-saves every turn to <cwd>/.arbor/conversations/<conv_id>/
    (messages.jsonl + meta.json), reusing the checkpoint contract's atomic
    JSONL IO. Best-effort — a failure logs and never breaks the chat.
  • arbor --continue / -C: reload the newest unfinished conversation and keep
    chatting (like claude -c). -c is already --config, so the short flag is -C.
  • /resume now lists saved conversations (tagged [chat]) alongside launched
    runs; a conversation reloads into the live agent, a run replays the orchestrator.
  • On resume (both paths) the prior exchange is replayed to the terminal.
  • A conversation is marked launched once it fires LaunchExperiment and is
    then excluded from --continue (the run's own checkpoint takes over).

New module src/cli/intake/conversation_store.py with full unit tests, plus
integration tests driving run_intake with the LLM call and input stubbed.
Docs (outputs-and-resume EN+zh) and both README command tables updated.

Linked issue / 关联 issue

Closes #36

Type of change / 改动类型

  • 🐞 Bug fix / 缺陷修复 (fix)
  • ✨ Feature / 新功能 (feat)
  • 📝 Docs / 文档 (docs)
  • ♻️ Refactor / 重构 (refactor)
  • ✅ Tests / 测试 (test)
  • 🔧 Chore / build / CI (chore)

How was this tested? / 如何验证?

uv run pytest tests/test_intake_conversation_store.py tests/test_intake_repl_autosave.py -q   # 16 passed
uv run pytest          # 430 passed, 6 skipped
uv run ruff check src/cli/intake/ src/cli/commands/run.py tests/test_intake_*.py   # clean

# Manual (editable install):
#   arbor -> chat -> /quit         => saved under .arbor/conversations/
#   arbor -C                       => continues last chat AND replays the prior exchange
#   arbor -> /resume               => lists the conversation tagged [chat] alongside runs

Checklist / 检查清单

  • PR title follows Conventional Commits (e.g. fix(config): ...). / PR 标题遵循 Conventional Commits 规范。
  • The change is focused and reasonably small. / 改动聚焦且体量合理。
  • I ran the relevant tests locally (python tests/test_*.py) and they pass. / 我已在本地运行相关测试并通过。
  • Docs / examples updated if behavior or config changed. / 若行为或配置有变更,已同步更新文档/示例(含 README.zh-CN.md)。
  • No secrets, API keys, or tokens are included in the diff. / diff 中不包含任何密钥、API key 或 token。

xxy33 added 2 commits June 25, 2026 14:03
The intake REPL (`arbor` with no subcommand) is a planning chat held before a
research run is launched. Until now it lived only in memory: quit before
launching and it was gone, so there was nothing to resume — only launched runs
under .arbor/sessions/ were ever persisted.

Auto-save the conversation every turn under
<cwd>/.arbor/conversations/<conv_id>/ (messages.jsonl + meta.json), reusing the
same atomic JSONL message IO as run checkpoints. Add two ways back in:

- `arbor --continue` / `-C`: reload the newest unfinished conversation and keep
  chatting (like `claude -c`). `-c` is already `--config`, so the short flag is
  `-C`.
- `/resume` inside intake now lists saved conversations alongside launched runs;
  picking a conversation reloads it into the live agent, picking a run replays
  the orchestrator as before.

On resume (both paths) the prior exchange is replayed to the terminal so you can
see the previous conversation, not just silently inherit its context.

A conversation is marked `launched` once it fires LaunchExperiment (the run's
own checkpoint takes over) and is then excluded from --continue. Saves are
best-effort: a failure logs and never breaks the chat.

New module src/cli/intake/conversation_store.py with full unit tests, plus
integration tests driving run_intake with the LLM call and input stubbed.
Add an "Outputs & Resume" section (EN + zh) covering the per-turn autosave under
.arbor/conversations/, `arbor --continue` / `-C`, and the extended `/resume`
that lists saved conversations alongside runs. Add an `arbor --continue` row to
both README command tables.
@ignorejjj ignorejjj merged commit 7ad3c07 into RUC-NLPIR:main Jun 25, 2026
7 checks passed
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.

[Feature]: the intake conversation to be resumable via /resume as well

2 participants