Skip to content

fix: v0.1.9 upgrade blockers (supervised sessions, cross-protocol daemon stop, Windows daemon job) - #477

Merged
lg2m merged 4 commits into
mainfrom
fix/pre-release-upgrade
Oct 26, 2026
Merged

lg2m merged 4 commits into
mainfrom
fix/pre-release-upgrade

Conversation

@lg2m

@lg2m lg2m commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Three upgrade bugs found while preparing v0.1.9.

What changes for users

  • Stores from v0.1.3–v0.1.8 open again. Those versions recorded write sub-agents with the supervised approval mode, which protocol 37 removed. Snapshots, event replay and completion reads failed on any session that had one. Store schema 64 rewrites those values to auto in session rows, journaled events and run completion receipts. Those children already run as auto today. For stores older than schema 62, the rewrite runs before the completion-receipt backfill, so those runs keep their results.
  • qq daemon stop and restart work across a protocol change. Before, they failed on the version check and left the old daemon running. They now use the shutdown request every daemon version answers, and discovery treats a discovery file left by another version as stale once its server no longer answers.
  • On Windows, a detached daemon outlives the shell that started it. It used to stay in the starter's job, so closing the terminal, SSH session or CI step killed it. It now breaks away from that job the same way the command worker does, and still starts inside a job that forbids breakaway.

Store schema goes from 63 to 64; protocol, capabilities and descriptor versions are unchanged. The release notes' Upgrading section should say: migration is forward-only, so back up the store first.

How I verified it

  • cargo xtask check passes on the full workspace (fmt, lint, clippy, nextest, doctests).
  • Each fix has a new test that failed before it:
    • a_store_with_retired_supervised_mode_opens_and_replays_as_auto, upgrading from schema 61 and from 63: before the fix the 63 case failed with Persistence(Constraint), and the 61 case lost its completion receipt.
    • restart_replaces_a_daemon_from_another_protocol_version (real binary): before the fix it failed with "server protocol version 39 does not match client version 40".
    • A qq-server unit test covers an embedded server refusing to stop and a dead daemon's leftover discovery file.
    • tests/daemon_windows.rs covers both a job that permits breakaway and one that forbids it. It runs in the native command owner (windows-latest) job, which this PR's ci:full label turns on, and passes there.
  • A copy of a real v0.1.8 store (22 supervised sessions, 94 events) failed under the old code. With the fix it migrated, all 56,934 events replayed, and every journaled run_finished event has its receipt.

Known regressions and budgets

None known. win32job is now a Windows-only dev-dependency; it was already in the lockfile.

lg2m added 3 commits October 26, 2026 10:17
v0.1.3 through v0.1.8 stored write sub-agents as `supervised`, a mode
protocol 37 removed. An upgraded store then failed every snapshot, event
replay and completion read that touched one. Store schema 64 rewrites
the session rows and every journaled session summary to `auto`, which
is how those children run now.
After an upgrade, `qq daemon stop` and `restart` failed on the version
check and left the old daemon running. Stopping now uses the shutdown
route every daemon shares, and discovery treats metadata another
version left behind as stale once its server no longer answers.
A detached daemon stayed in the job of the shell that started it, so
closing that terminal, SSH session or CI step killed it. It now breaks
away as the command worker does, and still starts inside a job that
forbids breakaway.
@lg2m lg2m added the ci:full label Oct 26, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T18:59:26.359130Z ce0240b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa851c4cea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Migration 62 builds run completion receipts by decoding journaled
run_finished events and skips any it cannot decode. In a store from
before 62, those events still said `supervised`, so the upgraded runs
lost their receipts. Rewrite the retired mode ahead of the backfill too.
@lg2m
lg2m merged commit 0175ed9 into main Oct 26, 2026
10 checks passed
@lg2m
lg2m deleted the fix/pre-release-upgrade branch October 26, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant