Files
hapi/cli/src/commands
1488be153a feat(cli): add hapi set-mode to change a session's permission mode (#2094) (#2095)
* feat(cli): add hapi set-mode to change a session's permission mode (#2094)

The CLI could only pick a permission mode at launch; changing it on an
existing session required the web UI or a hand-rolled JWT + curl call.

`hapi set-mode <session-id-or-prefix> <mode>` resolves the session like
ping-peer / inspect-peer, validates the mode against the session flavor's
catalog (printing the allowed list on mismatch), and calls the existing
POST /api/sessions/:id/permission-mode route. Active sessions switch live;
inactive ones keep the mode for the next resume.

No MCP tool is added: raising a peer's mode stays behind the agent's
normal shell-approval path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: reject Safe Yolo for shared sessions on the permission-mode route

Shared (concurrentClients) Codex sessions cannot launch with safe-yolo.
The web picker hides it, but the route only checked the flavor catalog,
so `hapi set-mode` (or any API client) could store it on an inactive
shared session and break its next resume. Guard the route and apply the
same filter to the CLI's allowed-mode list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 09:59:25 +08:00
..
2026-07-13 08:41:30 +08:00
2026-05-20 19:55:40 +08:00
2026-01-27 19:51:21 +08:00
2026-06-18 10:01:10 +08:00