Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

Prepare v0.302.74.1

justrach04edd487e0e3
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8d427c5f..60a33f25 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,10 @@ The release workflow uses a tag's section here as its release notes (a
hand-written `docs/releases/<tag>.md` wins if present), so keeping this file
current is part of cutting a release.
+## v0.302.74.1
+
+- A provider or model switch expands opaque compaction state from its exact checkpoint instead of replaying it to a seat that did not mint it. Switches after compaction no longer fail against ciphertext the new backend cannot decrypt, and the conversation after the window is kept (#1829, ADR 0317). Sessions with no checkpoint still stop once with history unchanged.
+
## v0.302.74
- Rejected encrypted compaction state can recover from a private pre-compaction checkpoint without losing later conversation. New server compactions retain exact input before replacing it; unavailable or invalid checkpoints leave history unchanged (#1822, ADR 0316).
diff --git a/docs/adr/0317-seat-change-expands-opaque-compaction.md b/docs/adr/0317-seat-change-expands-opaque-compaction.md
new file mode 100644
index 00000000..1b6cc3e0
--- /dev/null
+++ b/docs/adr/0317-seat-change-expands-opaque-compaction.md
@@ -0,0 +1,49 @@
+# 0317. A seat change expands opaque compaction state
+
+Status: accepted 2026-11-08
+
+## Context
+
+A server compaction item is ciphertext. It decrypts for the backend that
+minted it, and nothing in the item lets us tell whether the next seat can read
+it. A provider or model switch used to keep that item and replay it, so a
+valid conversation could be rejected with `invalid_encrypted_content` purely
+because the ciphertext belonged to the previous seat. The history was never
+wrong; only its provenance had moved.
+
+The switch path already handled the wire-format case: translate the history,
+or clear it. A same-format switch — another provider speaking Responses, or a
+different model on the same one — walked through untouched, which is the case
+that broke.
+
+## Decision
+
+Before a switch reaches the new seat, expand the newest opaque item back into
+the exact input it was compacted from (the checkpoint 0316 already retains)
+and drop the window fingerprint so it cannot be replayed.
+
+Same-seat switching is untouched. A history with no opaque item is untouched.
+A session with no checkpoint is left exactly as it is — the bounded recovery
+path reports the blocked state rather than guessing.
+
+This reaches the end state codex arrives at by stamping a compaction with the
+producing model and re-compacting when that hash changes; it matches the rule
+`subagent_history_copy` already enforces for forks, where a changed seat
+refuses to carry an opaque window.
+
+## Consequences
+
+A switch after compaction costs a re-expansion of history the checkpoint
+already holds: local disk read plus parse, no extra model call. The turn that
+follows sees real messages, so the new seat can compact again in its own
+terms, and the switch notice says the context was expanded rather than kept.
+
+The protection is only as good as the checkpoint. State predating 0316, or a
+checkpoint that is missing or corrupt, still fails closed: one rejected
+request, history unchanged, and an explanation. That is the honest outcome —
+nothing here can make a blob decrypt that the backend will not accept, and
+dropping the item instead would silently destroy the conversation it *is*.
+
+Revisit if a provider exposes a way to identify the encryption scope of an
+opaque item, which would let the expansion be skipped when the seat did not
+actually change.
diff --git a/docs/adr/README.md b/docs/adr/README.md
index c762ba40..647948a9 100644
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@ -341,6 +341,7 @@ record only when you need the evidence or the edge cases.
| [0314](0314-nanocua-is-grafts-computer-use.md) | Computer use on macOS is nanocua, a signed app shipped beside graff and offered as one MCP server; it works inside one app in the background, and the app's panel, not graff, says what it may do: graff and Harness can read its state and turn things off, but turning anything on takes a person's click in its window. nanoui's copy is generated from codegraff's and keeps codegraff's license. |
| [0315](0315-acp-explicit-command-intent.md) | Harness carries explicit command completion intent in ACP `_meta["harness/command"]`; literal slash prose bypasses dispatch and expansion, while legacy clients retain their syntax. |
| [0316](0316-rejected-compaction-restores-exact-input.md) | Server-compaction replacements retain private exact-input checkpoints; rejected state restores only a matching window plus its later tail, within a bounded recovery budget. |
+| [0317](0317-seat-change-expands-opaque-compaction.md) | A provider or model switch expands opaque compaction state from its checkpoint instead of replaying ciphertext the new seat cannot decrypt. |
| [0302](0302-sse-idle-watchdogs-follow-body-byte-progress.md) | SSE idle watchdogs observe partial body-byte progress, while separate unfinished-event time and size bounds preserve recovery. |
diff --git a/docs/releases/v0.302.74.1.md b/docs/releases/v0.302.74.1.md
new file mode 100644
index 00000000..ee4e4230
--- /dev/null
+++ b/docs/releases/v0.302.74.1.md
@@ -0,0 +1,13 @@
+# v0.302.74.1
+
+- A provider or model switch expands opaque compaction state back into the exact
+ input it was compacted from, instead of replaying it to a seat that did not
+ mint it. Switching after compaction no longer fails against ciphertext the new
+ backend cannot decrypt, and the whole conversation after the compacted window
+ is preserved (#1829).
+- Sessions with no usable checkpoint are unchanged: one rejected request, history
+ left intact, and an explanation of the blocked state.
+
+This release changes how a switch recovers. It does not make rejected state
+decryptable — a backend that will not accept a blob still will not, and detailed
+diagnostics and conversation contents stay local.
diff --git a/src/cli_text_source.zig b/src/cli_text_source.zig
index 34aa5a6a..c037166f 100644
--- a/src/cli_text_source.zig
+++ b/src/cli_text_source.zig
@@ -5,6 +5,9 @@
pub const changelog_text =
\\What's new
\\──────────
+ \\0.302.74.1
+ \\ • a provider or model switch expands opaque compaction state from its checkpoint instead of replaying it
+ \\
\\0.302.74
\\ • rejected compaction state restores exact input when a private checkpoint is available
\\ • short TLS-construction outages get a longer bounded recovery window