Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

cli: name a harness from its pane title when its engine session id is empty

Timab8dad36935b
diff --git a/cli/src/cli.ts b/cli/src/cli.ts
index ff2992038..1a619c430 100644
--- a/cli/src/cli.ts
+++ b/cli/src/cli.ts
@@ -1942,7 +1942,10 @@ async function runForeground(session: AuthSession | null): Promise<void> {
const title = engineSessionTitle(session, terminals.titleFor(session, titles))
if (!title) continue
const before = projectDisplayName(session)
- const updated = registry.updateTitle(session.sessionId, title)
+ // Fall back to the agent id: a terminal that became an engine harness (e.g. opencode typed
+ // into a New Terminal) has no engine session id — nothing fired a session-start hook — but its
+ // pane title is still readable and should still rename the harness.
+ const updated = registry.updateTitle(session.sessionId || session.agentId, title)
if (!updated) continue
const after = projectDisplayName(updated)
if (after !== before) {