A self-improving RLM agent for coding workflows and long-running autonomous tasks.
Rust
fix: keep legacy update request identities distinct (#3443)
kt11eabc798ec4
diff --git a/crates/pa-cli/src/update_flow/legacy_restart.rs b/crates/pa-cli/src/update_flow/legacy_restart.rsindex d0fbdc7467..9bafb422a2 100644--- a/crates/pa-cli/src/update_flow/legacy_restart.rs+++ b/crates/pa-cli/src/update_flow/legacy_restart.rs@@ -193,12 +193,13 @@ async fn restart(}),)?;let response = client- .request_with_timeout(+ .request_supervisor_with_id(DaemonCommand::PrepareUpdateRestart {id: None,update_id: None,rest: serde_json::Map::new(),},+ &format!("daemon_{}-prepare", id.0),// The shipped TS coordinator allows 120s; its own preparation// deadline is 100s, followed by worker commit and shutdown.budget.prepare_ms.max(120_000),@@ -256,12 +257,19 @@ async fn restart(identity_from_hello(client.hello()) == predecessor,"predecessor changed before shutdown");+ // TS deduplicates by client ID and envelope ID across connections.+ // A reconnected client's default counter restarts at daemon_1, which+ // would replay the prepare result instead of executing shutdown.let shutdown = client- .request_ok(DaemonCommand::Shutdown {- id: None,- force: None,- rest: serde_json::Map::new(),- })+ .request_supervisor_with_id(+ DaemonCommand::Shutdown {+ id: None,+ force: None,+ rest: serde_json::Map::new(),+ },+ &format!("daemon_{}-shutdown", id.0),+ 30_000,+ ).await;// TS shutdown waits for client sockets to close before exiting.// Drop the writer here; `close()` alone leaves its channel alive.@@ -487,6 +495,7 @@ mod tests {"appVersion":"0.6.0", "protocol":{"name":"prime-agent.daemon","version":7}});let owner = hello.clone();let server = tokio::spawn(async move {+ let mut prepare_key = None;for phase in ["prepare_update_restart", "shutdown"] {let (stream, _) = listener.accept().await.unwrap();let (read, mut write) = stream.into_split();@@ -498,11 +507,18 @@ mod tests {let command: Value =serde_json::from_str(&lines.next_line().await.unwrap().unwrap()).unwrap();assert_eq!(command["command"]["type"], phase);+ let key = (command["clientId"].clone(), command["id"].clone());if phase == "prepare_update_restart" {+ prepare_key = Some(key);persist(&source_copy, &manifest).unwrap();// The durable commit succeeds but its response disappears.drop(write);} else {+ assert_ne!(+ Some(key),+ prepare_key,+ "TS would replay prepare instead of executing shutdown"+ );sent.send(()).unwrap();std::future::pending::<()>().await;return;diff --git a/docs/legacy-upgrade-evidence.md b/docs/legacy-upgrade-evidence.mdindex d9ebf36dcf..e5e5156132 100644--- a/docs/legacy-upgrade-evidence.md+++ b/docs/legacy-upgrade-evidence.md@@ -6,10 +6,20 @@ Support scope starts at 0.6.0; no earlier versions are required.## Current verification status-The consolidated source includes recovery hardening and current-main integration.-Its final full repository gate and packaged-artifact migration rerun are pending.-Earlier successful results below identify their exact snapshot; they are not-silently attributed to the latest source.+The recovery-hardening snapshot passed the full repository gate, but its real+TS `/update` rerun exposed a request-ID collision after reconnecting: TS replayed+the preparation response instead of executing shutdown. The follow-up uses+distinct preparation and shutdown envelope IDs. A deliberate collision fails+the regression; the fix passes all six coordinator tests. Full gates and actual+migrations for this follow-up remain pending. Earlier results below are not+attributed to the latest source.++The consolidated full run encountered `ETXTBSY` (text file busy) in the existing+`update::download::tests::stages_a_local_payload_directory` test. A diagnostic+single-test run and the complete core library suite then passed (1,160 passed,+3 ignored), without product changes or retry logic. The cause is unproven; the+original failure is retained in `make-check-hardened-etxtbsy-red.log`. One fresh+full run passed; this does not by itself establish that the failure is fixed.| Check | Verified result || --- | --- |@@ -24,7 +34,7 @@ silently attributed to the latest source.| Busy-session continuation before follow-up input | Real worker regression reproduced red; 19 focused restore tests passed || npm bridge unit suite | 25 passed, including IPC, fd3, signals, retry, and prefix behavior || Packaging suites | 39 passed: native compatibility, restamping, decoder, catalog |-| Earlier full repository gate | fmt, clippy, 5,145 tests passed (19 ignored), release build passed |+| Consolidated full repository gate | fmt, clippy, 5,206 tests passed (19 ignored), release build passed |## Published-version matrix@@ -112,13 +122,13 @@ to `/tmp/prime-legacy-artifacts/` in the maintainer workspace. Key reports:`native-upgrade-evidence-optimized.tar.gz`, `native-tui-optimized-0.9.{5,6,7,8}.json`,`channel-install-probe-final.json`, `probe-red.json`, `probe-green.json`,`future-release-recovery.json`, `legacy-recovery-red-green.tar.gz`, and-`make-check-final.log`. Matrix bundles contain each case's exact archive and+`make-check-hardened.log`. Matrix bundles contain each case's exact archive andbridge hashes. Intermediate evidence remains in Git history and`evidence-history-before-condensing.md` beside the raw reports.## Remaining release gates and limits-- Rerun the full gate and migration matrix against the consolidated final source.+- Complete full gates and the migration matrix against the corrected optimized artifact.- Verify production artifacts on all supported hosts. The Linux candidate wasbuilt on Debian 12 with fixture catalog data. Its highest required GLIBCsymbol is 2.34, but that is not an Ubuntu 22.04 runtime test.