Repository navigation
Description
Operating system
Linux
Orca version
1.4.210 (headless orca serve). The code involved is unchanged on main at f5d2ce5, which includes 1.4.211.
Details
Short summary: when a headless orca serve runtime restarts and picks up the terminals that survived in the terminal daemon, those terminals come back with no title, an empty preview, no agent identity and status: null from terminal.agentStatus. They stay that way until the agent prints or reports something new, and an idle agent sitting at its prompt never does. The restore seeding added in #12579 exists, but this path never reaches it.
What happens
Two terminals in a throwaway serve instance: one sets a Claude-style idle title and sleeps, the other runs an idle Pi. Here is terminal list plus the terminal.agentStatus RPC, before and after systemctl --user restart of the runtime. The daemon PID is the same both times, and both terminals report connected: true afterwards:
| title | agentIdentity | preview | agentStatus | |
|---|---|---|---|---|
| A before | ✳ Claude Code |
claude |
shell text | running, idle |
| A after | null |
null |
"" |
not running, null |
| B (Pi) before | π - repo |
pi |
Pi footer | running, idle |
| B (Pi) after | null |
pi |
"" |
running, null |
orca terminal read still returns the output from before the restart, so the daemon has the history; it just never gets back into the runtime's records. On a real host, all 11 terminals had title: null after two serve restarts, and every idle agent that had not reported anything since the restart read as unknown.
How can we reproduce it?
The daemon has to survive the runtime restart. That is the case when serve runs as a systemd user unit (the daemon goes into its own orca-daemon-*.scope) or under a macOS LaunchAgent.
- Start an isolated runtime:
systemd-run --user --unit=orca-repro --setenv=XDG_CONFIG_HOME=/tmp/repro/config /usr/bin/orca-ide serve --port 6799 --no-pairing export ORCA_USER_DATA_PATH=/tmp/repro/config/orca, thenorca repo add --path <scratch repo>.- Create two terminals:
orca terminal create --worktree path:<repo> --command "sh -c 'printf \"\033]0;✳ Claude Code\007\"; echo repro; exec sleep 3600'"orca terminal create --worktree path:<repo> --command pi(any agent left idle at its prompt works)
- Check
orca terminal list --jsonand theterminal.agentStatusRPC for each handle. Both show a title andidle. - Run
systemctl --user restart orca-reproand wait forready. The daemon PID is unchanged. - Check the same things again. You get the "after" rows above.
Expected: re-adopted terminals keep their last title (and with it the title-based status and agent identity) and their preview, the same as terminals that come back through the reattach spawn path.
Why (at f5d2ce5)
- With no renderer re-spawning panes,
serveadopts surviving daemon sessions from the controller inventory:refreshPtyWorktreeRecordsWithControllerInventorycallsrecordPtyWorktree(session.id, …, { connected: true })(orca-runtime-refresh-pty-worktree-records-with-controller-inventory.ts:212). No restore payload is involved, soseedTerminalRestoreRecordsFromSpawnResultandseedTerminalRestoreTail, which are only called from the twospawn-commit.tsfiles, never run. fix(runtime): seed terminal previews and titles from restore payloads #12579 assumed that restart restores go through the renderer spawn handler. Seeding now also runs on the runtime-controller spawn path, but inventory adoption is a third path that never reaches it.agent-session-owners.ts:24warns that without the seed "headless/CLI-created reattaches stay blank", and that is what happens here. - The inventory can't carry the title either.
DaemonPtySessionInventory.listProcesseshardcodestitle: 'shell'(daemon-pty-session-inventory.ts:62), andSessionInfo(daemon/types.ts:369) has no title field. Yet the daemon trackslastTitleand already sends it with the reattach snapshot (daemon-pty-spawn-result.ts:325). RuntimeTerminalAgentStatusQueryis then left with no hook row (restored rows arerestoredUnconfirmedby design, fix(agent-status): restore hydrated nonterminal statuses as unconfirmed #12346) and no title, so it returnsstatus: null(runtime-terminal-agent-status-query.ts:129).
Impact
Anything that gates on agent status sees every idle agent as unknown after a serve restart or update, and it stays that way until someone prompts that agent. For example, an automated updater that waits until no agent is mid-turn has to treat unknown as busy, so it waits indefinitely. #13203 describes the same root cause (an idle pane stays silent after a restore) for orchestration mail delivery, but its fix is limited to that path.
Possible fix
- When the inventory adopts a live session whose record was never written (
restoredTerminalTailSeedAllowed), fetch the daemon's restore snapshot and run it throughseedTerminalRestoreTail, with the same seed rules as today (no waiters, nolastOutputAt). Or, lighter: - Add an optional
lastTitletoSessionInfo/PtyProcessInfofrom the daemon's title tracking, and seed it withapplySeededAgentStatuson adoption. Older protocol adapters would simply omit it.
Activity
AmethystLiang commentedon Sep 25, 2026
Thanks for reporting. Looking into it.
fix(runtime): restore a surviving PTY's title from the daemon after a…
brynnclaw commentedon Sep 30, 2026
A related case on Linux, for anyone who lands here with blank or missing terminals after a restart. It has a different cause, and #22834 is not expected to fix it.
On a headless Linux host (Ubuntu 24.04, systemd 255,
orca serveas a system unit withUser=<account>,Linger=no), the terminals did not come back at all. The service had been restarted while an SSH login of that account was open, so the daemon was placed inorca-daemon-<nonce>.scopeunder the account'suser@<uid>.service, which that login had started. About 10 s after the account's last SSH session closed, the user journal showedStopping orca-daemon-<nonce>.scope/Stopped orca-daemon-<nonce>.scope, and every terminal in it was gone.How to tell the two apart:
terminal listshows the terminals asconnected: true, andorca terminal readstill returns the old output. Only the title, preview, agent identity and status are missing.orca-daemon-*.scopebeing stopped around the time the last login closed. Nothing survived, so there is nothing for the adoption path to restore.A note for reproducing #22809 with
systemd-run --userover SSH: with lingering off, the user manager (and the transient unit with it) stops shortly after you log out, so keep the session open or runloginctl enable-lingerfor the test account first.The cause of the linger case is that the durable-scope probe accepts a user manager that exists only because a login session is open. I filed it separately as #24201.
AI disclosure: written with Claude Opus 5.5 (claude-opus-5-5), Anthropic; the journal lines are from the affected host.
nwparker commentedon Oct 24, 2026
Thanks for the detailed report and repro, mmarabel. Two fixes shipped in v1.4.228: #29623 keeps the tab titles of terminals a restarted server adopts, and #29654 republishes tabs when a restored title lands. Could you retest after an
orca serverestart on the latest build? If title, preview or agent status still come back empty, please reply or reopen and we will take another look.Sangkwun commentedon Oct 29, 2026
Retested on 1.4.244 (macOS 27.0.1, headless
orca serveunder a LaunchAgent). The restart was an in-place update from 1.4.243 through the runtime updater (updater.check,download,install). The terminal daemon and the agent processes survived it. I did not capture the terminal list before the restart.About 65 minutes after the restart,
orca terminal list --jsonon that host showed 19 terminals:title: nulllastOutputAt: nulllastOutputAtTwo of the 18 were Claude Code sessions that had started a new turn two to three minutes earlier and were still working. Both still had
title: null,lastOutputAt: nullandpreview: "", whileorca terminal read --screenreturned the current screen for both. Five other terminals of the 18 had their Claude Code process exit and start again in the same terminal one to five minutes before the list, and they also stayed attitle: nullandlastOutputAt: null. So the output reaches the runtime, but the restored records are not updated. On this build, printing something new does not bring a surviving terminal back.The missing state also has a safety side effect. A Claude permission menu that was open across the restart was not treated as a wait, and a retried
orca terminal send --text … --enterwas accepted and typed into the menu. I filed that separately as #35962.Sangkwun commentedon Oct 30, 2026
Two corrections to my comment above. "Five other terminals" should be "five terminals", because one of the five was also one of the two working sessions. And "returned the current screen for both" is not fully right: on one of the two screens, two rows near the bottom still showed a line from about seven hours before the restart, but the rest was current, so the conclusion stands. About 14 hours after the restart, the same 18 terminals still have
title: nullandlastOutputAt: null.fix(terminal): adopted daemon terminals take title and output from th…
fix(terminal): adopted daemon terminals take title and output from th…
nwparker commentedon Nov 8, 2026
Thanks Sangkwun for the detailed retest. That shows what was wrong: after a restart, a headless server never attached to the terminals it adopted, so their title, last output and preview were never updated. #36137 (v1.4.246) and #38760 (v1.4.252) fix this, and #38704 (v1.4.251) re-attaches after the daemon connection is rebuilt. Please update to v1.4.252 or later and restart serve once. If adopted terminals still show
title: null/lastOutputAt: nullon that version, please open a new issue and link this one.