opencode-windows-scheduler 1.5.4 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -5
- package/CROSS_PLATFORM.md +107 -71
- package/README.md +72 -25
- package/ROADMAP-STRATEGY.md +6 -0
- package/ROADMAP.md +116 -85
- package/dist/core/analytics.d.ts +3 -0
- package/dist/core/analytics.d.ts.map +1 -1
- package/dist/core/analytics.js +4 -0
- package/dist/core/audit.d.ts +2 -1
- package/dist/core/audit.d.ts.map +1 -1
- package/dist/core/audit.js +32 -1
- package/dist/core/cron-to-schtasks.d.ts.map +1 -1
- package/dist/core/cron-to-schtasks.js +21 -4
- package/dist/core/file-watcher.d.ts.map +1 -1
- package/dist/core/file-watcher.js +16 -1
- package/dist/core/git-trigger.d.ts +4 -2
- package/dist/core/git-trigger.d.ts.map +1 -1
- package/dist/core/git-trigger.js +34 -16
- package/dist/core/lock.d.ts +14 -0
- package/dist/core/lock.d.ts.map +1 -1
- package/dist/core/lock.js +81 -4
- package/dist/core/matrix.d.ts.map +1 -1
- package/dist/core/matrix.js +3 -2
- package/dist/core/native-notify.d.ts.map +1 -1
- package/dist/core/native-notify.js +3 -0
- package/dist/core/one-shot.d.ts +7 -1
- package/dist/core/one-shot.d.ts.map +1 -1
- package/dist/core/one-shot.js +15 -2
- package/dist/core/permissions.d.ts +69 -0
- package/dist/core/permissions.d.ts.map +1 -0
- package/dist/core/permissions.js +143 -0
- package/dist/core/ps-wrapper.d.ts +9 -2
- package/dist/core/ps-wrapper.d.ts.map +1 -1
- package/dist/core/ps-wrapper.js +293 -96
- package/dist/core/record-history.d.ts +11 -0
- package/dist/core/record-history.d.ts.map +1 -1
- package/dist/core/record-history.js +106 -4
- package/dist/core/savings.d.ts +70 -0
- package/dist/core/savings.d.ts.map +1 -0
- package/dist/core/savings.js +87 -0
- package/dist/core/schedule-gate.js +7 -3
- package/dist/core/schedule-v2.js +1 -1
- package/dist/core/scheduler/index.d.ts +13 -1
- package/dist/core/scheduler/index.d.ts.map +1 -1
- package/dist/core/scheduler/index.js +35 -4
- package/dist/core/scheduler/linux.d.ts +4 -1
- package/dist/core/scheduler/linux.d.ts.map +1 -1
- package/dist/core/scheduler/linux.js +53 -20
- package/dist/core/scheduler/mac.d.ts +2 -1
- package/dist/core/scheduler/mac.d.ts.map +1 -1
- package/dist/core/scheduler/mac.js +24 -6
- package/dist/core/scheduler/posix.d.ts +1 -1
- package/dist/core/scheduler/posix.d.ts.map +1 -1
- package/dist/core/scheduler/posix.js +2 -2
- package/dist/core/scheduler/registry.d.ts +3 -2
- package/dist/core/scheduler/registry.d.ts.map +1 -1
- package/dist/core/scheduler/registry.js +6 -5
- package/dist/core/scheduler/windows.d.ts +49 -1
- package/dist/core/scheduler/windows.d.ts.map +1 -1
- package/dist/core/scheduler/windows.js +219 -34
- package/dist/core/secrets.d.ts +5 -3
- package/dist/core/secrets.d.ts.map +1 -1
- package/dist/core/secrets.js +86 -8
- package/dist/core/self-analysis.d.ts +117 -0
- package/dist/core/self-analysis.d.ts.map +1 -0
- package/dist/core/self-analysis.js +539 -0
- package/dist/core/session.d.ts +11 -3
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +34 -5
- package/dist/core/shutdown.d.ts +26 -0
- package/dist/core/shutdown.d.ts.map +1 -0
- package/dist/core/shutdown.js +49 -0
- package/dist/core/summary.d.ts +69 -0
- package/dist/core/summary.d.ts.map +1 -0
- package/dist/core/summary.js +250 -0
- package/dist/core/telegram.d.ts +10 -0
- package/dist/core/telegram.d.ts.map +1 -1
- package/dist/core/telegram.js +228 -47
- package/dist/core/triage-chain.d.ts +9 -3
- package/dist/core/triage-chain.d.ts.map +1 -1
- package/dist/core/triage-chain.js +15 -5
- package/dist/core/triage-compare.d.ts +68 -0
- package/dist/core/triage-compare.d.ts.map +1 -0
- package/dist/core/triage-compare.js +184 -0
- package/dist/core/triage-rules.d.ts.map +1 -1
- package/dist/core/triage-rules.js +22 -0
- package/dist/core/triage-shadow.d.ts +54 -10
- package/dist/core/triage-shadow.d.ts.map +1 -1
- package/dist/core/triage-shadow.js +138 -26
- package/dist/core/triage-worker.d.ts +55 -0
- package/dist/core/triage-worker.d.ts.map +1 -0
- package/dist/core/triage-worker.js +314 -0
- package/dist/core/triage.js +1 -1
- package/dist/core/watch-paths.d.ts +6 -0
- package/dist/core/watch-paths.d.ts.map +1 -0
- package/dist/core/watch-paths.js +62 -0
- package/dist/core/wrappers/bash.d.ts +15 -3
- package/dist/core/wrappers/bash.d.ts.map +1 -1
- package/dist/core/wrappers/bash.js +153 -120
- package/dist/db/history-repo.d.ts +1 -1
- package/dist/db/history-repo.d.ts.map +1 -1
- package/dist/db/history-repo.js +29 -14
- package/dist/db/schema.d.ts +1 -1
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +31 -0
- package/dist/history.d.ts +2 -2
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +3 -3
- package/dist/i18n.d.ts +25 -2
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +41 -3
- package/dist/index.d.ts +40 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +345 -71
- package/dist/integrations.d.ts +9 -1
- package/dist/integrations.d.ts.map +1 -1
- package/dist/integrations.js +34 -6
- package/dist/notifications.d.ts +30 -2
- package/dist/notifications.d.ts.map +1 -1
- package/dist/notifications.js +287 -16
- package/dist/profiles.d.ts +1 -1
- package/dist/profiles.d.ts.map +1 -1
- package/dist/profiles.js +21 -3
- package/dist/rpc.d.ts +145 -8
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +81 -6
- package/dist/server.d.ts +20 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +136 -14
- package/dist/settings.d.ts +89 -5
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +143 -23
- package/dist/task-transfer.d.ts +8 -1
- package/dist/task-transfer.d.ts.map +1 -1
- package/dist/task-transfer.js +2 -2
- package/dist/types.d.ts +8 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +23 -5
- package/dist/workspaces.d.ts +9 -0
- package/dist/workspaces.d.ts.map +1 -1
- package/dist/workspaces.js +25 -0
- package/docs/ARCHITECTURE.md +40 -22
- package/docs/CONCEPT.md +230 -0
- package/docs/CROSS_PLATFORM.ru.md +150 -0
- package/docs/CROSS_PLATFORM.zh.md +146 -0
- package/docs/FAQ.md +52 -0
- package/docs/FAQ.ru.md +53 -0
- package/docs/FAQ.zh.md +43 -0
- package/docs/FEATURES.md +125 -48
- package/docs/FEATURES.zh.md +655 -0
- package/docs/LOCAL-AI.md +114 -16
- package/docs/README.ru.md +18 -13
- package/docs/README.zh.md +286 -0
- package/docs/SAVINGS.md +61 -0
- package/docs/SAVINGS.ru.md +60 -0
- package/docs/SAVINGS.zh.md +52 -0
- package/docs/ZH-LOCALE-PLAN.md +324 -0
- package/gui-experimental.cjs +8 -8
- package/locales/en.json +54 -1
- package/locales/ru.json +54 -1
- package/locales/zh.json +780 -0
- package/package.json +24 -7
- package/scripts/check-zh-locale.mjs +218 -0
- package/scripts/run-tests.mjs +236 -0
- package/scripts/test-locale.mjs +4 -3
- package/skills/scheduled-job-best-practices/SKILL.md +6 -3
- package/skills/scheduled-job-best-practices/references/recipes.md +1 -1
- package/src/core/analytics.ts +10 -0
- package/src/core/audit.ts +39 -1
- package/src/core/cron-to-schtasks.ts +23 -4
- package/src/core/file-watcher.ts +20 -1
- package/src/core/git-trigger.ts +34 -16
- package/src/core/lock.ts +88 -3
- package/src/core/matrix.ts +5 -1
- package/src/core/native-notify.ts +3 -0
- package/src/core/one-shot.ts +18 -2
- package/src/core/permissions.ts +200 -0
- package/src/core/ps-wrapper.ts +300 -96
- package/src/core/record-history.ts +111 -4
- package/src/core/savings.ts +150 -0
- package/src/core/schedule-gate.ts +9 -3
- package/src/core/schedule-v2.ts +1 -1
- package/src/core/scheduler/index.ts +41 -3
- package/src/core/scheduler/linux.ts +67 -22
- package/src/core/scheduler/mac.ts +24 -7
- package/src/core/scheduler/posix.ts +2 -2
- package/src/core/scheduler/registry.ts +7 -5
- package/src/core/scheduler/windows.ts +237 -32
- package/src/core/secrets.ts +101 -7
- package/src/core/self-analysis.ts +744 -0
- package/src/core/session.ts +40 -5
- package/src/core/shutdown.ts +69 -0
- package/src/core/summary.ts +318 -0
- package/src/core/telegram.ts +266 -55
- package/src/core/triage-chain.ts +15 -6
- package/src/core/triage-compare.ts +277 -0
- package/src/core/triage-rules.ts +23 -0
- package/src/core/triage-shadow.ts +176 -32
- package/src/core/triage-worker.ts +344 -0
- package/src/core/triage.ts +1 -1
- package/src/core/watch-paths.ts +70 -0
- package/src/core/wrappers/bash.ts +181 -138
- package/src/db/history-repo.ts +31 -18
- package/src/db/schema.ts +31 -0
- package/src/gui.tsx +5070 -4761
- package/src/history.ts +7 -3
- package/src/i18n.ts +55 -4
- package/src/index.ts +432 -74
- package/src/integrations.ts +50 -6
- package/src/notifications.ts +465 -18
- package/src/profiles.ts +21 -3
- package/src/rpc.ts +86 -6
- package/src/server.ts +135 -16
- package/src/settings.ts +305 -46
- package/src/task-transfer.ts +10 -3
- package/src/types.ts +24 -5
- package/src/workspaces.ts +22 -0
- package/dist/gui-experimental.cjs +0 -1
package/docs/FAQ.zh.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# 常见问题
|
|
2
|
+
|
|
3
|
+
常见问题与恢复场景。
|
|
4
|
+
|
|
5
|
+
Translations: [English](FAQ.md) · [Русский](FAQ.ru.md)
|
|
6
|
+
|
|
7
|
+
## 目录
|
|
8
|
+
|
|
9
|
+
- [`.corrupt-*` 隔离后如何恢复密钥](#隔离后如何恢复密钥)
|
|
10
|
+
- [Webhook 触发器:请求会被重放吗?](#webhook-触发器请求会被重放吗)
|
|
11
|
+
|
|
12
|
+
## 隔离后如何恢复密钥
|
|
13
|
+
|
|
14
|
+
当 `secrets.json` 无法解析(写入被中断或手工编辑)时触发隔离。文件**不会被删除**,
|
|
15
|
+
而是重命名为同目录下的 `secrets.json.corrupt-<时间戳>`。这是读取操作的副作用;
|
|
16
|
+
恢复**按设计是手工的**,以免任何自动重写破坏数据。
|
|
17
|
+
|
|
18
|
+
恢复步骤:
|
|
19
|
+
|
|
20
|
+
1. 在插件目录中找到该文件:`%APPDATA%\opencode\windows-scheduler\`(Windows)
|
|
21
|
+
或 `~/.config/opencode/windows-scheduler/`(macOS/Linux,或 `$XDG_CONFIG_HOME`)。
|
|
22
|
+
2. 用编辑器打开:通常是截断的 JSON,修正语法。
|
|
23
|
+
3. 把修好的文件复制回 `secrets.json`(保留 `.corrupt-*` 副本作为备份),
|
|
24
|
+
用 `manage_secrets`(`action: "list"`)验证。
|
|
25
|
+
4. 如果文件无法修复,重新设置密钥(`manage_secrets`,`action: "set"`)。
|
|
26
|
+
用丢失的 `secrets.key` 加密的值无法恢复——请重新输入。
|
|
27
|
+
5. 罕见情况:重命名失败且写入被阻止("Writing new secrets is blocked")。
|
|
28
|
+
手工移走损坏文件,然后重新设置密钥。
|
|
29
|
+
|
|
30
|
+
## Webhook 触发器:请求会被重放吗?
|
|
31
|
+
|
|
32
|
+
会——在两种剩余认证模式下请求都可被重放,因此防重放是发送方的责任:
|
|
33
|
+
|
|
34
|
+
- **带签名但未设置 `timestampToleranceSeconds`(= 0,旧模式)。** HMAC 只覆盖请求体,
|
|
35
|
+
被截获的请求可以永远重放。设置非零容忍窗口并发送 `X-Scheduler-Timestamp`:
|
|
36
|
+
签名随后覆盖 `<timestamp>.<body>`,窗口之外的请求会被拒绝。
|
|
37
|
+
- **仅 Token 模式。** Token 同样可被重放——调度器无法区分重复请求和攻击。
|
|
38
|
+
如果无法切换到签名:把 Token 放在 CI secrets 中,定期轮换,每个任务单独签发,
|
|
39
|
+
并让任务幂等。
|
|
40
|
+
- **GitHub Actions** 自己不发送 `X-Scheduler-Timestamp`,因此
|
|
41
|
+
`X-Hub-Signature-256` 以旧模式运行。可在单独的 workflow 步骤中用共享密钥
|
|
42
|
+
对 `<timestamp>.<body>` 签名。
|
|
43
|
+
- 调度器不保留重放缓存——对唯一请求去重是发送方的责任。
|
package/docs/FEATURES.md
CHANGED
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
A complete catalog of what the scheduler can do, with examples and the caveats that
|
|
4
4
|
matter in practice.
|
|
5
5
|
|
|
6
|
+
Translations: [中文](FEATURES.zh.md).
|
|
7
|
+
|
|
6
8
|
- [Scheduling](#scheduling)
|
|
7
9
|
- [Execution policy](#execution-policy)
|
|
8
10
|
- [Orchestration](#orchestration)
|
|
9
11
|
- [Multi-repository workspaces](#multi-repository-workspaces)
|
|
10
|
-
- [Profiles (multi-project)](#profiles-multi-project)
|
|
11
|
-
- [Workspace environment variables](#workspace-environment-variables)
|
|
12
|
+
- [Profiles (multi-project)](#profiles-multi-project-sprint-21)
|
|
13
|
+
- [Workspace environment variables](#workspace-environment-variables-sprint-21)
|
|
12
14
|
- [Observability](#observability)
|
|
13
15
|
- [Management](#management)
|
|
14
16
|
- [Agent interface](#agent-interface)
|
|
@@ -102,9 +104,9 @@ it is never accepted from user input or exported as plain text.
|
|
|
102
104
|
- `notBefore` / `notAfter` — daily launch window in `HH:MM` (may cross midnight,
|
|
103
105
|
e.g. `22:00`–`06:00`). A run that fires outside the window is **postponed**
|
|
104
106
|
until the window opens (once, via a defer-file), not skipped.
|
|
105
|
-
- `activeDays` — allowed weekdays `0`=Sunday … `6`=Saturday (
|
|
107
|
+
- `activeDays` — allowed weekdays `0`=Sunday … `6`=Saturday (Sprint 27). Empty or
|
|
106
108
|
all seven means every day. Applies to cron and event triggers.
|
|
107
|
-
- `windowPolicy` — behaviour outside the window or on a disallowed day (
|
|
109
|
+
- `windowPolicy` — behaviour outside the window or on a disallowed day (Sprint 27):
|
|
108
110
|
`postpone` (default) waits for the next opening (max 12 hours), `skip` drops the
|
|
109
111
|
run, `run` executes anyway.
|
|
110
112
|
- `pausedUntil` — pause a task until an ISO moment. `pause_task` accepts
|
|
@@ -125,27 +127,16 @@ it is never accepted from user input or exported as plain text.
|
|
|
125
127
|
The file is watched with chokidar in the plugin host, changes are debounced. File
|
|
126
128
|
triggers ignore `schedule`.
|
|
127
129
|
|
|
128
|
-
#### Glob
|
|
129
|
-
|
|
130
|
-
`watchGlobs` и `watchIgnore` ограничивают, какие изменения считаются триггером:
|
|
130
|
+
#### Glob masks for file triggers (Sprint 27)
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
{
|
|
134
|
-
"name": "regen-docs",
|
|
135
|
-
"triggerType": "file",
|
|
136
|
-
"watchPath": "C:\\projects\\site",
|
|
137
|
-
"watchGlobs": ["**/*.md", "**/*.html"],
|
|
138
|
-
"watchIgnore": ["node_modules/**", "**/*.log"],
|
|
139
|
-
"prompt": "Rebuild the static site when docs change."
|
|
140
|
-
}
|
|
141
|
-
```
|
|
132
|
+
`watchGlobs` and `watchIgnore` restrict which changes count as a trigger:
|
|
142
133
|
|
|
143
|
-
|
|
144
|
-
`?` (
|
|
145
|
-
(
|
|
146
|
-
|
|
134
|
+
Masks support `*` (does not cross `/`), `**` (any segments, including zero),
|
|
135
|
+
`?` (one character), `[abc]` / `[a-z]` (classes), `{a,b}` (alternatives) and `!`
|
|
136
|
+
(negation). Empty `watchGlobs` means "any change". Paths are normalized to POSIX
|
|
137
|
+
form (`\` → `/`), comparison is case-insensitive on Windows.
|
|
147
138
|
|
|
148
|
-
### Git triggers (
|
|
139
|
+
### Git triggers (Sprint 27)
|
|
149
140
|
|
|
150
141
|
```json
|
|
151
142
|
{
|
|
@@ -160,16 +151,15 @@ triggers ignore `schedule`.
|
|
|
160
151
|
}
|
|
161
152
|
```
|
|
162
153
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
поддерживает `*` и `?`).
|
|
154
|
+
A task with `triggerType: "git"` starts when a new commit appears in its working
|
|
155
|
+
directory. The first poll only remembers the current `HEAD` (baseline) and does not
|
|
156
|
+
start anything. Later polls compare `git diff --name-only <last>..HEAD` and start
|
|
157
|
+
the task when masks `gitPaths` (empty — any file) match and are not excluded by
|
|
158
|
+
`gitIgnore`. Filter `gitBranch` limits branches (comma-separated, supports `*` and `?`).
|
|
169
159
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
160
|
+
Poll period `gitPollSeconds` — minimum 5 seconds, default 60. State (the last
|
|
161
|
+
processed commit) is stored in SQLite table `git_state`, so a plugin restart does
|
|
162
|
+
not cause repeated runs.
|
|
173
163
|
|
|
174
164
|
### MCP event triggers
|
|
175
165
|
|
|
@@ -251,6 +241,12 @@ the scheduler entry.
|
|
|
251
241
|
|
|
252
242
|
### Tool restrictions
|
|
253
243
|
|
|
244
|
+
The baseline comes from `permissions.defaultPolicy`: `hybrid` (default) allows
|
|
245
|
+
read/edit/glob/grep/subagent/skill/webfetch/websearch and denies `shell` and `question`,
|
|
246
|
+
`secure` allows only read/glob/grep/skill, and `legacy` restores the 1.5.x behaviour that
|
|
247
|
+
allowed everything. Task-level `legacyShell: true` re-enables `shell` under `hybrid` for
|
|
248
|
+
jobs migrated from older versions; `legacy` is the blunt alternative.
|
|
249
|
+
|
|
254
250
|
`allowedTools` and `deniedTools` are enforced for the `opencode run` process that the
|
|
255
251
|
task wrapper starts. The wrapper passes the generated `permissions` rules to the
|
|
256
252
|
process through `OPENCODE_CONFIG_CONTENT`; no file is written to the task workdir, so a
|
|
@@ -339,7 +335,7 @@ Use `workspaceId` instead of `workingDirectory` to run a task in a workspace. Pa
|
|
|
339
335
|
validated on add/update/import, and the dashboard groups tasks and runs by workspace.
|
|
340
336
|
Workspaces are the unit that matrix builds fan out to.
|
|
341
337
|
|
|
342
|
-
## Profiles (multi-project,
|
|
338
|
+
## Profiles (multi-project, Sprint 21)
|
|
343
339
|
|
|
344
340
|
Profiles let you run several independent scheduler installations inside one plugin,
|
|
345
341
|
each with its own SQLite database, settings, logs, wrappers and dashboard port.
|
|
@@ -357,7 +353,7 @@ This is useful for separating projects, clients or environments (e.g. `default`
|
|
|
357
353
|
`set_profile` switches the active profile (restart hint); `create_profile` /
|
|
358
354
|
`delete_profile` manage named profiles (`default` cannot be deleted).
|
|
359
355
|
|
|
360
|
-
### Workspace environment variables (
|
|
356
|
+
### Workspace environment variables (Sprint 21)
|
|
361
357
|
|
|
362
358
|
Each workspace can carry env variables that are injected into every task run in that
|
|
363
359
|
workspace:
|
|
@@ -394,13 +390,19 @@ pre/post-flight results, next chained task, workspace and tool restrictions. Sta
|
|
|
394
390
|
|
|
395
391
|
Per-task counters and totals: runs, successes, errors, tokens, cost. Available through
|
|
396
392
|
`get_history`, the RPC layer and the dashboard header. A 14-day analytics slice —
|
|
397
|
-
|
|
393
|
+
Per-day buckets (UTC), success rate, token-based cost estimate, top tasks by cost,
|
|
398
394
|
matrix and model breakdowns — is available through `get_analytics` /
|
|
399
|
-
`GET /api/analytics` and the dashboard's
|
|
395
|
+
`GET /api/analytics` and the dashboard's **Analytics for the period** block.
|
|
400
396
|
pruned automatically (age and size limits, see Settings) and can be exported as
|
|
401
397
|
CSV/JSON (`GET /api/history/export`), or as OTLP/JSON for OpenTelemetry
|
|
402
398
|
(`GET /api/history/export?format=otlp`).
|
|
403
399
|
|
|
400
|
+
The same slice carries a **"Saved"** counter: runs that spent tokens without
|
|
401
|
+
a recorded cost (local models, prepaid plans) are priced against a reference cloud
|
|
402
|
+
rate of $0.01 / 1k tokens. The KPI is labelled as an estimate and links to
|
|
403
|
+
[docs/SAVINGS.md](SAVINGS.md) with the full methodology; `report.savings` exposes
|
|
404
|
+
`savedUsd`, `runs`, `tokens` and a per-task breakdown.
|
|
405
|
+
|
|
404
406
|
### Prometheus
|
|
405
407
|
|
|
406
408
|
`GET /metrics` exposes the Prometheus text format (0.0.4): `opencode_scheduler_info`,
|
|
@@ -433,6 +435,28 @@ token/signature/timestamp), 403 (channel disabled or credentials missing), 404
|
|
|
433
435
|
(unknown task), 413 (body over `maxBodyBytes`). The dashboard still binds to
|
|
434
436
|
localhost only, so external CI needs a tunnel or self-hosted runner.
|
|
435
437
|
|
|
438
|
+
#### Replay protection guidance for senders
|
|
439
|
+
|
|
440
|
+
Both remaining authentication modes are replayable at the transport level, so
|
|
441
|
+
senders should be chosen with that in mind:
|
|
442
|
+
|
|
443
|
+
- **Signature with `timestampToleranceSeconds = 0` (legacy).** The HMAC covers
|
|
444
|
+
only the body, so any intercepted request can be replayed verbatim, forever.
|
|
445
|
+
Set a non-zero tolerance and send `X-Scheduler-Timestamp` (unix seconds or
|
|
446
|
+
milliseconds): the signature then covers `<timestamp>.<body>` and a captured
|
|
447
|
+
request stops working outside the window.
|
|
448
|
+
- **Token-only mode.** A bearer token in a query parameter or header is also
|
|
449
|
+
replayable — the scheduler cannot distinguish a repeat from a replay. If you
|
|
450
|
+
cannot switch to timestamp-signed HMAC, mitigate instead: keep the token in
|
|
451
|
+
CI secrets (not in code), rotate it regularly, scope one token per task, and
|
|
452
|
+
make the target task idempotent so an accidental replay does no harm.
|
|
453
|
+
- **GitHub Actions.** GitHub does not send `X-Scheduler-Timestamp` itself, so
|
|
454
|
+
`X-Hub-Signature-256` alone runs in legacy (replayable) mode. Prefer a
|
|
455
|
+
workflow step that signs `<timestamp>.<body>` with the shared secret, or rely
|
|
456
|
+
on short-lived workflow runs and idempotent tasks.
|
|
457
|
+
- The scheduler itself performs no replay cache: unique-request deduplication
|
|
458
|
+
(e.g. event IDs) is the sender's responsibility.
|
|
459
|
+
|
|
436
460
|
### OpenTelemetry
|
|
437
461
|
|
|
438
462
|
History can be exported as OTLP/JSON: one span per run, deterministic 32-hex
|
|
@@ -501,23 +525,31 @@ and native OS notifications — configurable in settings and testable with
|
|
|
501
525
|
- **Quiet hours:** `quietHours.enabled` with `from`/`to` in `HH:MM` (an overnight
|
|
502
526
|
range such as 22:00 → 08:00 is supported). During the window `success` and
|
|
503
527
|
`partial` are suppressed while `error` and `timeout` are still delivered.
|
|
528
|
+
- **Dedup (31.2):** `notifications.dedup.enabled` groups identical task + status
|
|
529
|
+
notifications inside `windowMinutes` (default 60). With `suppressDuplicates`,
|
|
530
|
+
non-important repeats are suppressed; statuses listed in `importantStatuses`
|
|
531
|
+
(default `error`, `timeout`) are always delivered and get a localized repeat
|
|
532
|
+
suffix, e.g. `(repeat 3)`. Counters live in the SQLite `notification_dedup`
|
|
533
|
+
table, so they survive the short-lived `record-history` processes, and
|
|
534
|
+
`maxCount` caps the counter.
|
|
504
535
|
- **Matrix notifications:** on family completion — success, `partial` (`onPartial`)
|
|
505
536
|
and all clones failed (`onAllFailed`). A stuck detector reports clones running
|
|
506
537
|
longer than `matrix.stuckAfterMinutes` (default 60, `0` disables) once per run.
|
|
507
538
|
- **Digest:** `digest.enabled` sends a daily (`frequency: "daily"`, at `digest.time`)
|
|
508
539
|
or weekly (Mondays, catch-up afterwards) summary: runs, success rate, cost, tokens
|
|
509
540
|
and top errors through every enabled channel. Also available as the
|
|
510
|
-
`send_digest` RPC and the GUI's
|
|
541
|
+
`send_digest` RPC and the GUI's **Send digest now** button (manual sends
|
|
511
542
|
do not move the schedule).
|
|
512
543
|
- **Test button:** sends a test message to `all`, `webhook`, `telegram` or `native`
|
|
513
544
|
and reports per-channel success/failure. Failures in one channel never block the
|
|
514
545
|
others and never throw into the task run.
|
|
515
546
|
|
|
516
|
-
### Secrets (
|
|
547
|
+
### Secrets (Sprint 26)
|
|
517
548
|
|
|
518
549
|
Encrypted secret storage in `<PLUGIN_DIR>/secrets.json` with AES-256-GCM and a
|
|
519
|
-
32-byte key file `secrets.key` (
|
|
520
|
-
|
|
550
|
+
32-byte key file `secrets.key` (mode 0600 on POSIX; on Windows an ACL granting only
|
|
551
|
+
the current user, applied via `icacls`). The `manage_secrets` tool (and the **Secrets**
|
|
552
|
+
GUI panel) supports `list`, `set` and `delete`. Secret names match
|
|
521
553
|
`[A-Za-z0-9_.-]` and are up to 64 characters; list shows only name, masked preview
|
|
522
554
|
(`••••` + last 4 chars) and update time — never the value.
|
|
523
555
|
|
|
@@ -527,7 +559,28 @@ name-only warning). Secret references survive masking — they are shown verbati
|
|
|
527
559
|
the GUI env editor — while literal secret-like values (`TOKEN=`, `PASSWORD=`, …)
|
|
528
560
|
are masked as `***` in logs, structured logs, history and audit.
|
|
529
561
|
|
|
530
|
-
|
|
562
|
+
#### Recovering a quarantined secrets store
|
|
563
|
+
|
|
564
|
+
If `secrets.json` fails to parse, it is quarantined, not deleted: the file is
|
|
565
|
+
renamed to `secrets.json.corrupt-<timestamp>` next to the original. This is a
|
|
566
|
+
side effect of a read operation — recovery is **manual by design** so that no
|
|
567
|
+
automatic rewrite can destroy data:
|
|
568
|
+
|
|
569
|
+
1. Find the quarantined file in the plugin directory: `secrets.json.corrupt-*`
|
|
570
|
+
(Windows: `%APPDATA%\opencode\windows-scheduler\`, macOS/Linux:
|
|
571
|
+
`~/.config/opencode/windows-scheduler/` or `$XDG_CONFIG_HOME`).
|
|
572
|
+
2. Inspect it: the corruption is usually truncated JSON (interrupted write) or
|
|
573
|
+
manual editing. Fix the JSON syntax in a text editor.
|
|
574
|
+
3. Copy the fixed file back to `secrets.json` (keep the `.corrupt-*` copy as a
|
|
575
|
+
backup) and verify with `manage_secrets` (`action: "list"`).
|
|
576
|
+
4. If the file cannot be repaired, secrets are re-set with `manage_secrets`
|
|
577
|
+
(`action: "set"`); values encrypted with a lost `secrets.key` cannot be
|
|
578
|
+
recovered — re-enter them.
|
|
579
|
+
5. In the rarer case where even the rename failed, writes stay blocked
|
|
580
|
+
(`corruptedStore` is set) until the `.corrupt-*` path is cleared manually —
|
|
581
|
+
move the broken file away yourself, then re-set the secrets.
|
|
582
|
+
|
|
583
|
+
### Audit log (Sprint 26)
|
|
531
584
|
|
|
532
585
|
Every mutation — task create/update/delete/run, settings, templates, profiles,
|
|
533
586
|
workspaces, secrets, import, history cleanup — is recorded in an `audit_log`
|
|
@@ -535,7 +588,7 @@ table in SQLite with action, target type/target, actor (`mcp`/`gui`/`http`),
|
|
|
535
588
|
source, redacted details and remote address. Indexes on `ts` and `action`;
|
|
536
589
|
retention defaults to 90 days / 10 000 records with automatic cleanup.
|
|
537
590
|
|
|
538
|
-
The `get_audit_log` tool (and the
|
|
591
|
+
The `get_audit_log` tool (and the **Audit log** GUI panel) reads the journal
|
|
539
592
|
with filters by `action`, `target`, `actor`, `since`/`until` and `limit`. Also
|
|
540
593
|
available as RPC `get_audit` and HTTP `GET /api/audit`. Secret values in details
|
|
541
594
|
are redacted; `${secret:NAME}` references are preserved verbatim.
|
|
@@ -552,7 +605,7 @@ Global defaults (timeout, concurrency, notifications, history retention) live in
|
|
|
552
605
|
raw run log bounded: `history.retentionDays` (default 30) and `history.maxRecords`
|
|
553
606
|
(default 5000); `0` disables the respective limit. Cleanup runs at most once a day on
|
|
554
607
|
plugin start, records `lastCleanupAt` / `lastCleanupDeleted`, and is also available as
|
|
555
|
-
the `cleanup_history` RPC and the GUI's
|
|
608
|
+
the `cleanup_history` RPC and the GUI's **Clear now** button. Aggregates in
|
|
556
609
|
`metrics.json` are not affected by retention.
|
|
557
610
|
|
|
558
611
|
## Agent interface
|
|
@@ -575,16 +628,40 @@ The `manage_local_ai` tool reads, updates and tests the local triage settings
|
|
|
575
628
|
|
|
576
629
|
## Local assistant (triage)
|
|
577
630
|
|
|
578
|
-
An optional offline model classifies failed and partial runs
|
|
579
|
-
|
|
580
|
-
rules
|
|
631
|
+
An optional offline model classifies failed and partial runs (category, severity,
|
|
632
|
+
confidence, reason). The model never suppresses a notification by itself: only a
|
|
633
|
+
matching rules-engine rule with `action: "skip"` can do that. It is opt-in and
|
|
634
|
+
fail-open: without a model the rules engine or direct delivery takes over, and
|
|
635
|
+
notifications are never blocked by an unavailable model.
|
|
581
636
|
It never changes run status, retries, Quality Gates, DAG dependencies or history.
|
|
582
637
|
|
|
583
638
|
- `mode`: `off` (default), `rules`, `llm` or `auto` (model, then rules).
|
|
584
|
-
- `fallback`: `rules` (default) or `
|
|
639
|
+
- `fallback`: `rules` (default) or `notify` when the model fails or is unsure.
|
|
640
|
+
The legacy value `skip` is accepted as an alias for `notify`.
|
|
585
641
|
- `confidenceThreshold`: minimum model confidence (0..1).
|
|
586
|
-
-
|
|
587
|
-
|
|
642
|
+
- `rules` omitted means the built-in rules; `rules: []` disables them; a custom
|
|
643
|
+
array replaces the built-in set.
|
|
644
|
+
- Built-in rules cover errors, status, cost and task name
|
|
645
|
+
(deploy/release/backup/migration); all are notify-only. Examples are in
|
|
646
|
+
[LOCAL-AI.md](LOCAL-AI.md).
|
|
647
|
+
- The GUI shows a colored connection status (not checked / checking /
|
|
648
|
+
connected / no connection) and resets it when the mode, URL or model changes.
|
|
649
|
+
- In `llm`/`auto`, triage is asynchronous: the notification is delivered
|
|
650
|
+
immediately and a detached worker writes the verdict to the audit. Only
|
|
651
|
+
`rules` mode triages before delivery, because only rules can suppress.
|
|
652
|
+
- `notifications.embedding` adds semantic dedup on top of the exact dedup:
|
|
653
|
+
messages are converted to normalized bag-of-words vectors stored in SQLite,
|
|
654
|
+
compared by cosine similarity against the window, and suppressed above
|
|
655
|
+
`threshold` (0.85 default). Important statuses are never suppressed. No new
|
|
656
|
+
dependencies and no external embedding model are required.
|
|
657
|
+
- `notifications.summary` renders at most three short lines for Telegram and
|
|
658
|
+
toasts. The model returns strict JSON `{"lines": [...]}`; any failure falls
|
|
659
|
+
back to deterministic truncation (status, error, runtime/tokens/cost), and
|
|
660
|
+
delivery waits at most `summary.timeoutMs` (8 s default).
|
|
661
|
+
- Shadow mode logs decisions to the persistent audit journal
|
|
662
|
+
(`get_audit_log`, action `triage.decision`) without suppressing notifications,
|
|
663
|
+
so triage can be evaluated safely before it is enforced and the report
|
|
664
|
+
survives restarts.
|
|
588
665
|
|
|
589
666
|
Setup, model tiers by RAM, the `npm run bench:local` benchmark, shadow workflow
|
|
590
667
|
and troubleshooting (including `OLLAMA_CONTEXT_LENGTH`) are documented in
|