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.

docs(cli): say what the flag probe cannot answer, and whose exit it describes

0xken155dc7ed89fb90
diff --git a/cli/src/cli.ts b/cli/src/cli.ts
index e0a674589..cd8a0329b 100644
--- a/cli/src/cli.ts
+++ b/cli/src/cli.ts
@@ -4550,6 +4550,9 @@ async function runForeground(session: AuthSession | null): Promise<void> {
// or why it left. openharness#285 was exactly this: opencode printed its help over a flag
// it did not know, and the only trace was one line saying the pane had become a terminal.
// `describeAgentCreateFailure` was written for this and had no caller.
+ // `dead: true` describes the ENGINE, which is what the diagnosis is about, not the pane —
+ // the pane is alive and about to become a terminal. That is the sentence this state
+ // selects ("started and exited with status N"), and it is the true one here.
const captured = await captureTerminal(pending.agentId, 40)
console.warn(`[agent] create · ${engine} · agent ${sid(pending.agentId)} · `
+ describeAgentCreateFailure({
diff --git a/cli/src/lib/engineLaunch.ts b/cli/src/lib/engineLaunch.ts
index ac3defed9..e5bf09ce2 100644
--- a/cli/src/lib/engineLaunch.ts
+++ b/cli/src/lib/engineLaunch.ts
@@ -901,6 +901,13 @@ export function permissionFlagToVerify(engine: AgentEngine, choice: PermissionLa
*
* `null` means "launch as asked": either nothing is being added, or the engine takes it, or the
* probe could not tell (`unknown` never refuses — see `commandSupportsFlagInInteractiveShell`).
+ *
+ * Best-effort by construction, and that is the right way round. The probe needs an interactive
+ * shell to resolve the engine the way a launch will, so a machine that offers none answers
+ * `unknown` and nothing is refused. A daemon started by systemd or in a container has no `SHELL`
+ * in its environment — measured on a Linux container here — but `currentUserShell` falls back to
+ * the passwd entry, which on a normal account is a real shell, so the check does reach the boxes
+ * openharness#285 came from.
*/
async function unsupportedPermissionFlag(
engine: AgentEngine,