Inbox: reach an Orca chat whose Claude session is asleep

未关闭
#3,869 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
34/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
backend

调研方向

Start by finding where the Inbox stores a reply for an ended session and where a session resume (same id, --resume) is detected — that is the hook needed to flush saved replies as the next wake. Then look at the inboxLaunch.startIn option (alongside rex, and the Herdr request in #3726) and the command builder behind it, which must emit orca orchestration send using ORCA_AGENT_SESSION_ID and the bot name from ~/.orca/bots/<name>. The optional inboxLaunch.wakeCommand with {session}, {cwd}, {thread}, {replyFile} placeholders is a separate, larger design piece. Done means a reply saved after a session ended arrives when that session is resumed, and an ended Orca chat can be woken through Orca.

由索引模型根据 Issue 内容生成。

描述

Problem

Orca runs each chat as a Claude Code session through the Agent SDK (CLAUDE_CODE_ENTRYPOINT=orca, the panel exception from #3325). It does not keep the claude process running between turns. When a message comes in through Orca, Orca starts it again with claude --resume=<session id>, so the chat keeps the same session id and its whole history.

The Inbox reaches the chat only while that process is alive. A few minutes after a turn ends, the thread shows "This Claude Code session has ended", and any reply waits:

  • A reply in the thread is saved: "That session has ended; it gets this only if it's resumed."
  • When Orca resumes the same session id for another reason (a message from another chat), the saved reply is still not delivered. Tested: a reply was saved at 11:41, Orca resumed that session at 11:44 and ran a full turn, and the transcript has no "The plannotator plugin sent a message" turn.
  • "Start a new one" runs claude --bg. That gives a new session id with only part of the history, outside Orca, so the chat never shows it, and its owner cannot see or stop it there. Ours read the thread and archived it, but did not do the rest of what the original chat had been asked to do.

So a question asked from an Orca chat can only be answered within a few minutes. Anything answered later goes to a session the person never sees.

Request

  1. Deliver saved replies when a session comes back under the same id. When a session with saved replies connects again (Orca's --resume, or any host that resumes), send them as its next wake, as a live session gets them.

  2. Wake ended Orca chats through Orca. Add "orca" to inboxLaunch.startIn (next to "rex", and like the Herdr request in #3726). For a session whose entrypoint was orca, "Reply" and "start a new one" would run:

    orca orchestration send --to bot:<bot name> --chat <orca chat id> --type question \
      --subject "Plannotator Inbox: <thread title>" --body "<the reply, with its reply id>"
    

    Orca then resumes the same session inside the chat, so the reply lands where the conversation lives. Orca exposes the chat id in the session's environment (ORCA_AGENT_SESSION_ID), and the bot name comes from the folder (~/.orca/bots/<name>).

    A general option would cover Orca, Herdr and wrappers alike (#3064 asked for the launch command): inboxLaunch.wakeCommand with placeholders such as {session}, {cwd}, {thread} and {replyFile}, run when the session has ended.

Related

  • #3325: Orca chat sessions get the Inbox tools (only while the session is running).
  • #3726: inboxLaunch.startIn: "herdr", the same need for Herdr.
  • #3064: choose the command used to start a Claude Code session (closed by #3097, which added a model, effort and a settings file instead).

Setup

Plannotator 0.29.2, Claude Code 2.1.330, Orca 1.4.269, Linux (Ubuntu), Inbox reached over Tailscale.

主要语言
TypeScript
星标
8.7k
派生
649
平均合并
16 小时 1 分钟
30 天内合并 PR
756

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

backnotprop/plannotator 的其他 Issue

查看 backnotprop/plannotator 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。