Skip to content

[Feature]: Long-running work an agent detaches (nohup/tmux/ssh) leaves the chat showing done #34305

Open

Description

@YangNuoCheng

Problem or use case

I often ask an agent in an Orca chat to run something long: a benchmark sweep, a training run, usually on a GPU server over ssh. The agent starts it detached (setsid nohup over ssh, tmux, a background codex exec), says "I'll report back", and ends its turn. From then on the sidebar shows the chat as done with a green check, although the job is still running. When the job dies, or never started, nothing changes and nobody is told.

A real case from today: an agent launched two sweeps on a server. One ran. The other failed at once (nohup: cannot run command ...: Permission denied) because its script lacked the execute bit, but the launch command still printed "started", so the agent reported both as running. The chat showed done the whole time. From the chat alone I could not tell whether anything was running, waiting for me, or dead.

Orca already has the right state for this: a chat whose own background command is still running shows working · monitoring, lists the task, and turns done (with a notification) when it ends. I checked this with a Codex chat: a background-terminal sleep 150 kept the chat in monitoring and it flipped to done about 150 s later. Work the agent detaches from itself never reaches that roster.

Proposed solution

Teach chat agents to keep detached work visible, using the plugin Orca already delivers to every chat agent (resources/native-chat-visuals, given to Claude as a plugin and to Codex and ACP agents as a skills root). A new skill, orca-chat-background-work, tells the agent to:

  • run long work as one of its own background commands when it can;
  • when the work must be detached or runs on another machine, start a watcher as its own background command that lives exactly as long as the work, e.g. ssh HOST 'while kill -0 PID; do sleep 30; done; tail -n 20 LOG', so the chat stays in monitoring and turns done when the work ends;
  • check that the process exists and its log grows before saying it started;
  • look (process alive, log age, last line) before reporting progress.

No code changes; the existing background-task tracking does the rest. I have it working and can open a PR.

Alternatives or additional context

A built-in way to register external work (e.g. orca chat task add --check ...) that Orca polls itself would also cover jobs started outside an agent, and could show progress and staleness in the task row. That touches the child-work model and would need a design decision from maintainers, so I would treat it as a follow-up. The skill works with today's Orca.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions