Skip to content

Commit f84fc57

Browse files
authored
Merge branch 'main' into fix/webchat-inflight-cursor-replay
2 parents a251afa + d68ddc6 commit f84fc57

106 files changed

Lines changed: 3225 additions & 468 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,6 @@ extensions/discord/assets/embedded-app-sdk.mjs
233233
/.opengrep-out/
234234
/.crabbox-artifacts
235235
.comux*
236+
237+
# Pinned Swift lint/format tools installed by scripts/install-swift-tools.sh
238+
.build/

‎apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18150,6 +18150,7 @@ public struct ExecApprovalRequestParams: Codable, Sendable {
1815018150
public let approvalreviewerdeviceids: [String]?
1815118151
public let requiredeliveryroute: Bool?
1815218152
public let suppressdelivery: Bool?
18153+
public let delivertoapprovalclientsonly: Bool?
1815318154
public let timeoutms: Int?
1815418155
public let twophase: Bool?
1815518156

@@ -18180,6 +18181,7 @@ public struct ExecApprovalRequestParams: Codable, Sendable {
1818018181
approvalreviewerdeviceids: [String]? = nil,
1818118182
requiredeliveryroute: Bool? = nil,
1818218183
suppressdelivery: Bool? = nil,
18184+
delivertoapprovalclientsonly: Bool? = nil,
1818318185
timeoutms: Int? = nil,
1818418186
twophase: Bool? = nil)
1818518187
{
@@ -18209,6 +18211,7 @@ public struct ExecApprovalRequestParams: Codable, Sendable {
1820918211
self.approvalreviewerdeviceids = approvalreviewerdeviceids
1821018212
self.requiredeliveryroute = requiredeliveryroute
1821118213
self.suppressdelivery = suppressdelivery
18214+
self.delivertoapprovalclientsonly = delivertoapprovalclientsonly
1821218215
self.timeoutms = timeoutms
1821318216
self.twophase = twophase
1821418217
}
@@ -18240,6 +18243,7 @@ public struct ExecApprovalRequestParams: Codable, Sendable {
1824018243
case approvalreviewerdeviceids = "approvalReviewerDeviceIds"
1824118244
case requiredeliveryroute = "requireDeliveryRoute"
1824218245
case suppressdelivery = "suppressDelivery"
18246+
case delivertoapprovalclientsonly = "deliverToApprovalClientsOnly"
1824318247
case timeoutms = "timeoutMs"
1824418248
case twophase = "twoPhase"
1824518249
}

‎docs/cli/onboard.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ Output: `--suppress-gateway-token-output` disables the automatic Control UI hand
369369

370370
<Note>
371371
`--json` does not imply non-interactive mode in guided or classic onboarding.
372+
Without an interactive terminal, both onboarding modes return a structured
373+
JSON error; add `--non-interactive --accept-risk` for automation.
372374
With `--modern`, JSON is a one-shot OpenClaw overview and exits after that
373375
single result. Use `--non-interactive` for other scripts.
374376
</Note>

‎docs/tools/exec-approvals.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,32 @@ Each allowlist entry supports:
421421
| `lastUsedCommand` | Last command that matched; omitted for generated hashed argv entries |
422422
| `lastResolvedPath` | Last resolved binary path |
423423

424+
## Cron standing grants
425+
426+
Approvals raised by gateway-host cron runs are delivered only to connected
427+
approval surfaces (Control UI, TUI, macOS app) — never to chat channels, which
428+
would repeat a card on every occurrence. While a reviewer surface is
429+
connected, the scheduled run waits for the decision like an interactive run;
430+
cron jobs are single-flight, so at most one card per job is pending at a
431+
time. With no approval surface connected, the request is denied immediately
432+
and the run's error explains the policy fix, exactly as before. Node-host
433+
cron execs keep the fully headless policy (no cards) until node execution
434+
gains its own standing-grant path.
435+
436+
When an approval originates from a cron job's isolated run, resolving it with
437+
**allow always** does not write a JSON allowlist entry. Instead the Gateway
438+
mints a scoped standing grant bound to that exact agent, cron job, job
439+
configuration, and operation (command text, working directory, and requested
440+
environment). Later occurrences of the same job execute that exact operation
441+
without prompting while the grant is valid.
442+
443+
A grant expires 30 days after the approval and fails closed back to a normal
444+
prompt whenever anything changed: the job was edited or deleted, the command,
445+
working directory, or environment differs, the grant expired or was revoked,
446+
or the original approval record is gone. Mutable file operands and commands
447+
that require explicit review (heredocs, strict inline eval, audit
448+
suppression) keep prompting per occurrence. Non-cron approvals are unchanged.
449+
424450
## Auto-allow skill CLIs
425451

426452
When **Auto-allow skill CLIs** (`autoAllowSkills`) is enabled, executables

‎extensions/buzz/src/setup-core.test.ts‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,62 @@ describe("buzzSetupContract", () => {
77
vi.unstubAllEnvs();
88
});
99

10+
it.each([
11+
{
12+
name: "plaintext private key",
13+
privateKey: "11".repeat(32),
14+
},
15+
{
16+
name: "private-key SecretRef",
17+
privateKey: { source: "env" as const, provider: "default", id: "BUZZ_EXISTING_KEY" },
18+
},
19+
])("rejects named account setup without changing the existing $name", ({ privateKey }) => {
20+
const buzz = {
21+
enabled: false,
22+
relayUrl: "wss://original.example.com",
23+
privateKey,
24+
authTag: '["auth","owner","kind=9","signature"]',
25+
};
26+
const cfg = { channels: { buzz } } as OpenClawConfig;
27+
const input = {
28+
relayUrl: "wss://new.example.com",
29+
privateKey: "22".repeat(32),
30+
};
31+
const requestedAccountId = "ada";
32+
const resolvedAccountId =
33+
buzzSetupContract.resolveAccountId?.({ cfg, accountId: requestedAccountId, input }) ??
34+
requestedAccountId;
35+
36+
expect(resolvedAccountId).toBe(requestedAccountId);
37+
expect(buzzSetupContract.validateInput?.({ cfg, accountId: resolvedAccountId, input })).toBe(
38+
"Buzz currently supports only the default account.",
39+
);
40+
expect(cfg.channels?.buzz).toEqual(buzz);
41+
});
42+
43+
it("rejects named environment-backed setup without changing the existing bot identity", () => {
44+
const existingPrivateKey = "11".repeat(32);
45+
vi.stubEnv("BUZZ_PRIVATE_KEY", existingPrivateKey);
46+
const buzz = {
47+
enabled: false,
48+
relayUrl: "wss://original.example.com",
49+
authTag: '["auth","owner","kind=9","signature"]',
50+
};
51+
const cfg = { channels: { buzz } } as OpenClawConfig;
52+
const input = { relayUrl: "wss://new.example.com", useEnv: true };
53+
const requestedAccountId = "ada";
54+
const resolvedAccountId =
55+
buzzSetupContract.resolveAccountId?.({ cfg, accountId: requestedAccountId, input }) ??
56+
requestedAccountId;
57+
58+
expect(resolvedAccountId).toBe(requestedAccountId);
59+
expect(buzzSetupContract.validateInput?.({ cfg, accountId: resolvedAccountId, input })).toBe(
60+
"Buzz currently supports only the default account.",
61+
);
62+
expect(cfg.channels?.buzz).toEqual(buzz);
63+
expect(process.env.BUZZ_PRIVATE_KEY).toBe(existingPrivateKey);
64+
});
65+
1066
it("validates and applies BUZZ_PRIVATE_KEY setup without storing the key", () => {
1167
expect(buzzSetupContract.metadata.fields.find((field) => field.key === "useEnv")).toMatchObject(
1268
{

‎extensions/buzz/src/setup-core.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export function isSameBuzzIdentity(currentKey?: string, nextKey?: string): boole
4242
}
4343

4444
const buzzSetupAdapter: ChannelSetupAdapter<BuzzSetupInput> = {
45-
resolveAccountId: () => DEFAULT_ACCOUNT_ID,
4645
applyAccountName: ({ cfg, accountId, name }) =>
4746
applyAccountNameToChannelSection({
4847
cfg,

‎extensions/matrix/src/matrix/client-resolver.test-helpers.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function createMockMatrixClient(): MatrixClient {
4646
start: vi.fn(async () => undefined),
4747
stop: vi.fn(() => undefined),
4848
stopAndPersist: vi.fn(async () => undefined),
49-
stopWithoutPersist: vi.fn(() => undefined),
49+
stopWithoutPersist: vi.fn(async () => undefined),
5050
} as unknown as MatrixClient;
5151
}
5252

0 commit comments

Comments
 (0)