jg-agent-hq 13.1.0 → 13.1.1
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
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 13.1.1
|
|
4
|
+
|
|
5
|
+
- Preserve quarantined Codex controls and their producing runtime epoch during shutdown. Stopping HQ no longer turns unverified native ownership into a managed inactive record or discards its recorded turn, so the next runtime can explicitly recover a still-loaded idle or active session. Queued input stays paused and no input is replayed.
|
|
6
|
+
- Keep the existing storage schema, action key and public request contracts unchanged.
|
|
7
|
+
|
|
3
8
|
## 13.1.0
|
|
4
9
|
|
|
5
10
|
- Let explicit `thread-recover` with `recovery: { kind: 'resume' }` rejoin a known Codex identity that remains loaded idle or active after its previous HQ runtime stopped. Read and bind its current turn before joining without settings or input, then verify the turn again before acknowledging recovery. A reissued approval belongs to that verified active turn.
|
package/api/README.md
CHANGED
|
@@ -107,6 +107,8 @@ The socket accepts at most 32 simultaneous connections. Requests are bounded to
|
|
|
107
107
|
|
|
108
108
|
After a live Codex connection loss, the runtime rechecks the bounded cohort it controlled with no action in flight before that loss. It stops the old proxy before replacing it, then reads and rejoins each eligible session once, without settings or input. The saved native turn must still match before and after joining. Matching running turns continue; confirmed completions settle their receipts without a result and release their ready queued input. Newer external turns, failed reads/joins and unacknowledged operations remain uncertain. Live output reports a gap, and partial result capture is discarded. This recovery does not claim that native commands or their process handles survived a daemon restart. It never resumes an external session or repeats an uncertain action. A second loss is a new bounded recovery attempt, not a retry of input.
|
|
109
109
|
|
|
110
|
+
Shutdown preserves a quarantined Codex record's uncertain ownership, producing runtime epoch and recorded native-turn evidence. The next runtime leaves it quarantined for explicit recovery, including when the native turn is still active. Stopping HQ does not prove that Codex stopped or that an uncertain action failed, and never converts that record into a managed inactive control.
|
|
111
|
+
|
|
110
112
|
Codex approval identities are scoped to their native connection, because a replacement daemon may reuse request IDs. A reissued request opens a new approval; earlier approvals stay expired. A response prepared for an earlier connection cannot write to or decline a request on its replacement. The native response still uses the exact request ID supplied by Codex.
|
|
111
113
|
|
|
112
114
|
## Providers and capabilities
|
|
@@ -23,6 +23,7 @@ export declare class ControlLifecycle extends ControlModel {
|
|
|
23
23
|
/**
|
|
24
24
|
* Marks controls inactive only after its caller has proven native shutdown. A session a native
|
|
25
25
|
* process keeps running stays bound to this runtime, for the next one to rejoin.
|
|
26
|
+
* Quarantined Codex controls retain their producing epoch and evidence for explicit recovery.
|
|
26
27
|
*/
|
|
27
28
|
releaseControls(): void;
|
|
28
29
|
/** Lists the sessions another runtime left running, which this runtime rejoins, oldest first. */
|
|
@@ -36,11 +36,12 @@ export class ControlLifecycle extends ControlModel {
|
|
|
36
36
|
/**
|
|
37
37
|
* Marks controls inactive only after its caller has proven native shutdown. A session a native
|
|
38
38
|
* process keeps running stays bound to this runtime, for the next one to rejoin.
|
|
39
|
+
* Quarantined Codex controls retain their producing epoch and evidence for explicit recovery.
|
|
39
40
|
*/
|
|
40
41
|
releaseControls() {
|
|
41
42
|
this._transaction(() => {
|
|
42
43
|
const now = Date.now();
|
|
43
|
-
this._statements.run(`UPDATE agent_hq_thread SET runtime_epoch = NULL, pending_action_id = NULL, active_turn_id = NULL, ownership = CASE WHEN native_id IS NULL THEN 'uncertain' ELSE 'managed' END, state = CASE WHEN native_id IS NULL THEN 'unknown' ELSE 'inactive' END, updated_at = ? WHERE runtime_epoch = ? AND NOT (${KEPT_SESSION_CONDITION})`, now, this._epoch);
|
|
44
|
+
this._statements.run(`UPDATE agent_hq_thread SET runtime_epoch = NULL, pending_action_id = NULL, active_turn_id = NULL, ownership = CASE WHEN native_id IS NULL THEN 'uncertain' ELSE 'managed' END, state = CASE WHEN native_id IS NULL THEN 'unknown' ELSE 'inactive' END, updated_at = ? WHERE runtime_epoch = ? AND NOT (${KEPT_SESSION_CONDITION}) AND NOT (provider = 'codex' AND ownership = 'uncertain')`, now, this._epoch);
|
|
44
45
|
this._statements.run("UPDATE agent_hq_action SET delivery = 'uncertain', updated_at = ? WHERE runtime_epoch = ? AND delivery = 'submitted'", now, this._epoch);
|
|
45
46
|
this._statements.run("UPDATE agent_hq_action SET queue_ready = 0 WHERE runtime_epoch = ? AND delivery = 'queued'", this._epoch);
|
|
46
47
|
this._statements.run("UPDATE agent_hq_native_approval SET state = 'expired', updated_at = ? WHERE runtime_epoch = ? AND state = 'pending'", now, this._epoch);
|
package/docs/recovery.md
CHANGED
|
@@ -36,6 +36,8 @@ A shared Codex daemon restart can interrupt every managed Codex session's live c
|
|
|
36
36
|
|
|
37
37
|
For a session left uncertain, stop its producing HQ runtime and inspect the native identity and competing controllers before explicit recovery in the next runtime. `thread-recover` with `recovery: { kind: 'resume' }` can rejoin its already known Codex identity even when the daemon still holds it idle or active. The verified current turn is bound before joining and checked again afterward; no settings or input are sent. Reissued approvals can then be answered explicitly. Earlier queued entries stay paused, uncertain input receipts stay unresolved, and unknown state or a turn changing during the join leaves control uncertain. Never use attach/create to replace a known native identity or replay work to recover control.
|
|
38
38
|
|
|
39
|
+
Quarantined Codex records retain their producing epoch and turn evidence across shutdown. Earlier releases could instead leave a known record managed and inactive after shutdown; inspect that state and use a confirmed `thread-resume` only once its native session is idle or unloaded. Do not change ownership records by hand or replace the identity to bypass the native-state checks.
|
|
40
|
+
|
|
39
41
|
## Off-machine durability
|
|
40
42
|
|
|
41
43
|
The development helper examples/shared-storage.ts demonstrates a host-owned application table, maintenance, capture and offline restore using public exports. Capture already returns verified metadata, so the helper avoids an immediate extra full-database inspection. Its application transaction commits independently of capture. Inspect the restored values before starting a recovered runtime with explicitly chosen roots.
|
package/package.json
CHANGED