You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/agent/README.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,14 @@ Four modes defined in `src/execution-mode.ts`:
74
74
75
75
In cloud background mode, permissions are always auto-approved. In interactive mode, the permission system is active and configurable per session. Tool categorization lives in `src/adapters/claude/tools.ts` — each tool belongs to a group (read, write, bash, search, web, agent) and modes whitelist groups.
76
76
77
+
Cloud provisioning can pass `--posthogExecPermissionRegex <regex>` to require
78
+
one-time client approval for matching PostHog MCP `exec` sub-tools in every
79
+
interactive Claude and Codex permission mode. Matching is case-insensitive
80
+
against the delegated name in `call [--json] <sub-tool> ...`. These prompts do
81
+
not offer an always-allow choice and are not remembered. Background runs keep
82
+
their existing auto-approval behavior. The default is
`createAcpConnection()` in `src/adapters/acp-connection.ts` is the heart of the package. It's a factory that returns a `{ clientStreams, cleanup }` object — a pair of ndJson `ReadableStream`/`WritableStream` that the caller uses to speak ACP.
@@ -142,9 +150,12 @@ JWT validation (`src/server/jwt.ts`) uses RS256 with a configurable public key.
142
150
143
151
When `POST /command` receives a `user_message`, it doesn't handle it directly — it calls `clientConnection.prompt()` on the ACP `ClientSideConnection`, which sends a `session/prompt` message through the ACP streams to the agent. Similarly, `cancel` sends `session/cancel`. This means all commands follow the same path as in-process calls from PostHog Code, with the HTTP layer just being a thin translation.
144
152
145
-
### Auto-approval in cloud mode
153
+
### Permission routing in cloud mode
146
154
147
-
The `AgentServer` provides a `requestPermission` callback to the `ClientSideConnection` that always selects the "allow" option. In background mode this is necessary (no human to ask). In interactive mode it currently does the same, with a TODO for future per-tool approval via SSE round-trips.
155
+
The `AgentServer` provides the `requestPermission` callback to the
156
+
`ClientSideConnection`. Background mode selects an allow option automatically.
157
+
Interactive mode relays approvals that need a person over SSE and parks them
158
+
until a client responds; other requests follow the selected permission mode.
0 commit comments