jg-agent-hq 13.7.0 → 13.7.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 +5 -0
- package/api/README.md +2 -0
- package/dist/store/control/outcomes/outcomes.model.js +10 -0
- package/docs/recovery.md +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 13.7.1
|
|
4
|
+
|
|
5
|
+
- Release the settled reservation after a definitively rejected Codex resume and quarantine its known native identity. Explicit recovery can rejoin that same session without restarting HQ or replaying input, including after a rejected recovery attempt.
|
|
6
|
+
- Keep unconfirmed resume outcomes fenced, failed receipts intact and earlier queued input paused.
|
|
7
|
+
|
|
3
8
|
## 13.7.0
|
|
4
9
|
|
|
5
10
|
- Keep ordinary Claude input submitted for up to five minutes after its stdin write is accepted. Late acknowledgement settles the original input, and actual connection failure still updates control immediately.
|
package/api/README.md
CHANGED
|
@@ -311,6 +311,8 @@ Version 13 expands the producer contract: a 12.x consumer's strict 32-character
|
|
|
311
311
|
|
|
312
312
|
Codex may keep an idle native thread loaded after `thread/unsubscribe`, as when a terminal still holds it. An explicitly confirmed resume may reacquire that thread when its known managed control is inactive and managed, without settings overrides. Ordinary resume still refuses active native threads, uncertain managed ownership and already controlled idle sessions.
|
|
313
313
|
|
|
314
|
+
A definitively rejected Codex resume settles its failed receipt, quarantines the known native identity and releases that action's pending reservation. This also applies to a rejected recovery resume. Explicit recovery can then inspect and rejoin the same identity in the current runtime; it never retries the rejected action or sends input. Earlier queued entries stay paused. A dispatched resume with an unconfirmed outcome retains its pending reservation and remains ineligible for current-runtime recovery.
|
|
315
|
+
|
|
314
316
|
Explicit `thread-recover` with `recovery: { kind: 'resume' }` can rejoin a quarantined managed record's known Codex identity in the current runtime without restarting HQ, whether unloaded or still loaded idle or active. No action may remain in flight. The operator must inspect its ownership evidence and stop competing controllers that could submit work. HQ reads its current native turn, binds it before joining so reissued approvals find their turn, then verifies the same turn again before acknowledging recovery. It changes no settings, sends no input, leaves earlier queued entries paused and does not resolve uncertain input receipts. Unknown execution state, a mismatched workspace/identity or a changed turn refuses recovery. Healthy ownership and pending dispatches remain ineligible. Earlier queued receipts retain this recovery action as `relatedActionId`; completion and later automatic reconnects leave those entries paused until explicitly sent or cancelled. Recovery that attaches an identity after uncertain creation and ordinary adoption retain their existing unloaded-session checks.
|
|
315
317
|
|
|
316
318
|
Receipts separate `delivery` (`queued`, `submitted`, `acknowledged`, `uncertain`, `failed`, `canceled`) from nullable native turn `completion` (`completed`, `failed`, `interrupted`). Acknowledgement means the exact native request was accepted, not that the turn or tool completed. Permission replies remain submitted after a pipe write and become acknowledged only when Codex resolves the exact native request or Claude returns a tool-result block for the exact tool-use identity. Claude cancellation expires the prompt and leaves an unacknowledged written reply uncertain. Resolution does not prove a tool ran. The receipt includes managed and native identity, its nullable `provider`, digest, timestamps, safe failure classification and optional related action. Its `phase` is the native step the action takes now: `create`, `resume`, `name`, `turn`, `steer`, `interrupt`, `clean`, `close`, `delete` or `reply`. A create continues with `name` once its session exists, and with `turn` when it carries a first input; a close's `interrupt` continues with `clean` once the turn ends, and its `clean` with `close`; a deletion of a session the runtime runs takes `clean` and `close` before `delete`. An action that sends nothing native, such as queued input before it is sent, has none. Only selected receipts expose `nativeThreadId`, the native session of the action's thread once the runtime records it, undelivered `queuedInput` and the nullable complete native `result`; collection reads omit all three. Queued input retains prepared text, native skill identity, content-bound file references and explicit turn settings, never file bytes or skill content. It is cleared after delivery acknowledgement or cancellation.
|
|
@@ -134,6 +134,16 @@ export class ControlOutcomes extends ControlModel {
|
|
|
134
134
|
(action.kind === 'thread-delete' && action.phase === 'delete');
|
|
135
135
|
if (isReleased && thread?.pending_action_id === action.id)
|
|
136
136
|
this._statements.run('UPDATE agent_hq_thread SET pending_action_id = NULL, updated_at = ? WHERE id = ?', now, thread.id);
|
|
137
|
+
else if (outcome.kind === 'failed' &&
|
|
138
|
+
action.phase === 'resume' &&
|
|
139
|
+
thread?.provider === 'codex' &&
|
|
140
|
+
thread.native_id !== null &&
|
|
141
|
+
thread.runtime_epoch === this._epoch &&
|
|
142
|
+
thread.pending_action_id === action.id) {
|
|
143
|
+
// a rejected binding stays quarantined, but its settled failure cannot hold recovery's slot
|
|
144
|
+
this._statements.run("UPDATE agent_hq_thread SET ownership = 'uncertain', pending_action_id = NULL, state = 'unknown', updated_at = ? WHERE id = ?", now, thread.id);
|
|
145
|
+
this._statements.run("UPDATE agent_hq_action SET queue_ready = 0 WHERE thread_id = ? AND delivery = 'queued'", thread.id);
|
|
146
|
+
}
|
|
137
147
|
else if (ownsThread && thread.pending_action_id === action.id) {
|
|
138
148
|
if (action.kind === 'thread-rename' && outcome.kind === 'failed')
|
|
139
149
|
this._statements.run('UPDATE agent_hq_thread SET pending_action_id = NULL, updated_at = ? WHERE id = ?', now, thread.id);
|
package/docs/recovery.md
CHANGED
|
@@ -64,6 +64,8 @@ For a known Codex session left uncertain, inspect its native identity and close
|
|
|
64
64
|
|
|
65
65
|
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.
|
|
66
66
|
|
|
67
|
+
A definitively rejected Codex resume, including a recovery resume, leaves its failed receipt intact and quarantines the same native identity while releasing the settled action's reservation. After inspection, explicit recovery can rejoin it without restarting HQ or repeating input. Earlier queued input remains paused. An unconfirmed dispatched resume retains its reservation: an uncertain outcome does not establish rejection or permit another current-runtime resume.
|
|
68
|
+
|
|
67
69
|
## Off-machine durability
|
|
68
70
|
|
|
69
71
|
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