From 55ecbf4fb86a17f0775c403cb02ff1e50941de80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Fri, 21 Aug 2026 19:42:04 +0000 Subject: [PATCH] the handoff radio was still rendered nowhere, one layer above where it was fixed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Exit and hand back to the agent, then re-arm" is the only fire behaviour a commander wants, and it is the dialog's own default inside one. It was missing from the dialog in Command HQ. The previous fix wired the consumer: isCommander={manager.context === 'command-hq'}, with a comment about how the prop had never been passed by anybody. The producer was still not feeding it. EmbeddableChat builds its manager from its OWN props — useEmbeddableChat(params) — and `context` there is a different value from the `context` handed to useChat. Command HQ set the hook's and not the component's, so manager.context was undefined, and the radio stayed hidden in the one place it exists for. Two hooks named alike sitting on either side of that boundary is what hid it twice: hooks/useChat.ts and EmbeddableChat/useEmbeddableChat.ts, one taking a `context` option, the other a `context` prop, neither reading the other's. Found by the owner trying to arm a deploy commander and finding only "stop when it fires", a one-shot, where a watcher that re-arms was the whole point. Co-Authored-By: Claude Opus 5 --- .../officerdev/src/apps/CommandHQ/CommandHqDetail.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/workspaces/officerdev/src/apps/CommandHQ/CommandHqDetail.tsx b/src/workspaces/officerdev/src/apps/CommandHQ/CommandHqDetail.tsx index 52008275..ed93cab0 100644 --- a/src/workspaces/officerdev/src/apps/CommandHQ/CommandHqDetail.tsx +++ b/src/workspaces/officerdev/src/apps/CommandHQ/CommandHqDetail.tsx @@ -99,7 +99,11 @@ function NewCommander({ New commander )} - + {/* `context` is a prop of EmbeddableChat, and it is NOT the `context` handed to `useChat` above. + `useEmbeddableChat(params)` builds the manager from these props, and `manager.context` is what the + composer reads to decide whether to offer "exit and hand back, then re-arm". Passing it to the hook + and not to the component left that radio hidden inside a commander — the one place it exists for. */} + ); } @@ -293,6 +297,7 @@ function ResumedCommander({ sessionId, resume }: { sessionId: string; resume: Re