Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
70a6655
docs: design rescue progress lifecycle
vitry Aug 7, 2026
2c52cc5
docs: harden progress event rendering
vitry Aug 7, 2026
82182b3
docs: plan rescue progress lifecycle
vitry Aug 7, 2026
d6a542b
feat: add safe zcode progress reporting
vitry Aug 7, 2026
24ab317
fix: harden zcode progress reporter lifecycle
vitry Aug 7, 2026
ad56595
feat: persist and render zcode job progress
vitry Aug 7, 2026
995b4db
fix: show progress placeholders for legacy jobs
vitry Aug 7, 2026
52a93a0
fix: harden zcode progress timestamps and rendering
vitry Aug 7, 2026
f3b1714
feat: surface live zcode task activity
vitry Aug 7, 2026
e718b48
fix: drain progress before terminal transition
vitry Aug 7, 2026
6989664
fix: preserve progress lifecycle error semantics
vitry Aug 7, 2026
78d73f7
fix: cancel foreground zcode jobs on interrupt
vitry Aug 7, 2026
48434e7
fix: preserve interrupt during authorization read
vitry Aug 7, 2026
c100645
fix: close authorization input on interrupt
vitry Aug 7, 2026
2853a24
fix: cancel foreground transfers on interrupt
vitry Aug 7, 2026
9366b3f
fix: retain transfer client ownership on interrupt
vitry Aug 7, 2026
7e559b9
docs: explain zcode progress and interruption behavior
vitry Aug 7, 2026
8fc7b66
fix: defer progress until send acceptance
vitry Aug 7, 2026
1438b9e
fix status wait signal interruption
vitry Aug 7, 2026
56a8125
fix: show cancellation errors in job status
vitry Aug 7, 2026
4fd1441
fix foreground signal race semantics
vitry Aug 7, 2026
16e8f71
fix: bound progress persistence backlog
vitry Aug 7, 2026
2f84fd8
fix: emit coalesced progress when persisted
vitry Aug 7, 2026
0b9441a
test: stabilize incomplete authorization interrupt
vitry Aug 7, 2026
f3384de
test: skip unsupported Windows signal delivery
vitry Aug 7, 2026
9101e03
fix: close interrupted authorization pipes
vitry Aug 7, 2026
6f6dbc1
fix: normalize authorization stream creation errors
vitry Aug 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ All notable changes follow Semantic Versioning.
- Added marketplace-qualified plugin-data discovery and a restart-safe `$zcode:setup` bootstrap that configures the data directory as a writable root before persisting state.
- Added ZCode CLI 0.16.1 compatibility for runtime-preference server requests with string IDs.
- Improved `$zcode:setup` guidance when the ZCode CLI has no model provider configured, including the distinction between Desktop and CLI settings and API-key providers that do not require OAuth.
- Added foreground activity output, a 20-second heartbeat, and durable status previews for long-running ZCode work.
- Added bounded foreground `SIGINT` and `SIGTERM` handling: the plugin cancels before session creation or sends `session/stop` only to the exact persisted ZCode session, while background jobs continue until completion or explicit cancellation with `$zcode:cancel`.
- Kept the package version at `0.1.0` for these Unreleased behavior changes.

## 0.1.0 - 2026-08-06

Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ To verify configuration, rerun `$zcode:setup`, then run `$zcode:rescue --fresh -

Every run is reserved as a durable, owner-scoped job. Installed plugin state lives beneath `$CODEX_HOME/plugins/data/zcode-<marketplace>/workspaces/<workspace-hash>/` with private permissions; prompts, results, session IDs, and logs are never written into the repository or plugin cache. `$zcode:status`, `$zcode:result`, and `$zcode:cancel` work across later turns in the same Codex session, while sibling sessions cannot adopt a job.

Foreground runs stream ZCode activity to the current terminal. If no new activity arrives, they emit a 20-second heartbeat so a long model or tool call remains visibly alive. The same safe activity is stored on the job; `$zcode:status <job-id>` shows its phase, last activity time, and recent progress previews. For example:

```text
$zcode:rescue --wait repair the failing tests
[zcode] ZCode started a tool call.
[zcode] Still waiting for ZCode; last activity 20s ago.

$zcode:status <job-id>
Status: running
Phase: running
Progress:
- ZCode started a tool call.
```

Background jobs have a separate lifecycle: ending the launching foreground command or Codex turn does not automatically cancel them. Use `$zcode:status <job-id>` to inspect one and `$zcode:cancel <job-id>` for explicit cancellation; ownership remains limited to the Codex session that reserved the job.

On supported foreground paths, `SIGINT` and `SIGTERM` are observed at safe protocol boundaries. Before a ZCode session exists, interruption cancels the queued reservation. Once the exact persisted ZCode session ID exists, the plugin sends `session/stop` only for that session. A confirmed stop durably marks the job cancelled; if `session/stop` fails or times out, the job remains running with the cancellation error available through status so cancellation can be retried. This is intentionally a session-level boundary: the plugin does not claim to stop or kill arbitrary detached grandchildren created by ZCode or nested tools.

Transfer reads a persisted Codex thread through `codex app-server` and imports only ordered visible user/assistant text. It does not transfer hidden reasoning, tools, permissions, or ZCode job ownership.

The optional Stop review gate runs a bounded foreground read-only review only after a changed, user-driven parent turn. Enable or disable it with `$zcode:setup`; a Codex restart may be required. Missing, outdated, or unauthenticated ZCode fails open with setup guidance. Once a review session starts, malformed, failed, or timed-out review output blocks conservatively.
Expand Down
18 changes: 18 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ Setup 会把以下 schema 写入 `$CODEX_HOME/plugins/data/zcode-<marketplace>/w

每次运行都会先建立持久、带 owner 的 job。已安装插件的状态保存在 `$CODEX_HOME/plugins/data/zcode-<marketplace>/workspaces/<workspace-hash>/`,使用私有权限;prompt、result、session ID 和日志都不会写进仓库或插件缓存。后续 turn 仍可使用 `$zcode:status`、`$zcode:result`、`$zcode:cancel`,但 sibling Codex session 无法接管任务。

前台运行会把 ZCode 活动流式显示在当前终端。如果没有新活动,则每 20 秒输出一次心跳,让耗时较长的模型请求或工具调用仍然可见。同一份安全活动也会持久化到 job;`$zcode:status <job-id>` 会显示阶段、最后活动时间和近期进度预览。例如:

```text
$zcode:rescue --wait 修复失败的测试
[zcode] ZCode started a tool call.
[zcode] Still waiting for ZCode; last activity 20s ago.

$zcode:status <job-id>
Status: running
Phase: running
Progress:
- ZCode started a tool call.
```

后台任务有独立生命周期:启动它的前台命令或 Codex turn 结束时,后台任务不会自动取消。用 `$zcode:status <job-id>` 查看,用 `$zcode:cancel <job-id>` 显式取消;ownership 仍只属于预留该 job 的 Codex session。

在支持的前台路径上,插件会在安全协议边界处理 `SIGINT` 和 `SIGTERM`。ZCode session 尚未建立时,中断会取消排队中的预留;精确持久化的 ZCode session ID 一旦存在,插件只会对该 session 发送 `session/stop`。停止得到确认后,job 会持久标记为 cancelled;如果 `session/stop` 失败或超时,job 会保持 running,并通过 status 暴露取消错误,以便重试取消。这是刻意限定的 session 级边界:插件不声称停止或杀死 ZCode 或嵌套工具创建的任意 detached grandchildren。

Transfer 通过 `codex app-server` 读取持久 Codex thread,只导入按顺序排列、用户可见的 user/assistant 文本;不转移隐藏推理、工具状态、permission 或 job ownership。

可选 Stop review gate 只会在用户驱动的父 turn 确实改变工作区后执行有界、前台、只读审查。用 `$zcode:setup` 开关,可能需要重启 Codex。ZCode 缺失、过旧或未认证时会附 setup 指引并 fail open;一旦审查会话已启动,畸形、失败或超时输出会保守阻止结束。
Expand Down
Loading
Loading