jg-agent-hq 13.5.2 → 13.5.3

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.5.3
4
+
5
+ - Keep controller creation, adoption, resume and recovery in the existing preparation state until native readiness. Opening a session without input no longer reports a turn starting or completing, preventing false completion notifications. Genuine input and autonomous native turns retain their lifecycle events.
6
+ - Preserve the storage schema, action key, input receipts and queue admission without migration or replay.
7
+
3
8
  ## 13.5.2
4
9
 
5
10
  - Automatically rejoin previously managed Codex sessions after a shared connection loss or HQ restart when their verified latest native turn changed. Joining sends no input or settings, leaves earlier receipts unresolved and queues paused, and still refuses unverified state, pending submissions and turn changes during the join. Existing uncertain/external sessions still require explicit recovery.
package/api/README.md CHANGED
@@ -405,6 +405,8 @@ Codex leaves `reasoning` items out as it reads them, so a Codex page can hold fe
405
405
 
406
406
  ## Session states
407
407
 
408
+ Controller setup uses the managed record's existing `creating` preparation state for creation, adoption, resume and recovery. Until native readiness its session state is unknown, rather than a running inference turn. Readiness alone records `opened`, never `turn-completed`; `starting` is reserved for an action that actually submits turn input. Verified existing turns and autonomous native output still record their actual lifecycle.
409
+
408
410
  Every session has a live state: `running`, `waiting` (on the operator), `idle`, `closed`, `failed` or `unknown`. A managed session reports it from its managed record. A session another client drives is observed and listed with `ownership: 'external'`; the runtime sends it no input until `thread-adopt` records it as managed, and never stops, wakes or drives a session a terminal runs. A managed session the runtime closed is observed again, so a terminal that continues it shows its state.
409
411
 
410
412
  A retained session with uncertain ownership also takes its live state from native observation, including loaded Codex sessions found at startup and later status changes. Thread reads, discovery and active-session summaries retain its managed ID and `ownership: 'uncertain'`. Observation never changes its control record, settles uncertain input, advances queued input or restores execution authority. Without a native observation its state remains unknown; explicit recovery is still required to regain control.
@@ -242,7 +242,7 @@ export class ControlAdmission extends ControlModel {
242
242
  }
243
243
  if (isCreating)
244
244
  phase = 'create';
245
- this._statements.run("UPDATE agent_hq_thread SET ownership = 'managed', runtime_epoch = ?, pending_action_id = ?, active_turn_id = NULL, state = ?, updated_at = ? WHERE id = ?", this._epoch, action.id, isCreating ? 'creating' : 'starting', now, threadId);
245
+ this._statements.run("UPDATE agent_hq_thread SET ownership = 'managed', runtime_epoch = ?, pending_action_id = ?, active_turn_id = NULL, state = 'creating', updated_at = ? WHERE id = ?", this._epoch, action.id, now, threadId);
246
246
  if (prepared.recoveryTurn !== undefined) {
247
247
  if (command.kind !== 'thread-recover' ||
248
248
  command.recovery.kind !== 'resume' ||
@@ -359,7 +359,7 @@ export class ControlAdmission extends ControlModel {
359
359
  this._conflict();
360
360
  const threadId = randomUUID();
361
361
  this._statements.run(`INSERT INTO agent_hq_thread (id, provider, native_id, name, workspace_root, ownership, runtime_epoch, pending_action_id, state, registration_action_id, created_at, updated_at)
362
- VALUES (?, ?, ?, ?, ?, 'managed', ?, ?, ?, ?, ?, ?)`, threadId, provider, nativeId ?? null, name, prepared.workspaceRoot, this._epoch, actionId, nativeId ? 'starting' : 'creating', actionId, now, now);
362
+ VALUES (?, ?, ?, ?, ?, 'managed', ?, ?, ?, ?, ?, ?)`, threadId, provider, nativeId ?? null, name, prepared.workspaceRoot, this._epoch, actionId, 'creating', actionId, now, now);
363
363
  this._statements.run('UPDATE agent_hq_action SET thread_id = ?, requested_name = ?, provider = ? WHERE id = ?', threadId, name, provider, actionId);
364
364
  if (prepared.input) {
365
365
  this._statements.run('UPDATE agent_hq_action SET queued_input = ? WHERE id = ?', JSON.stringify(prepared.input), actionId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jg-agent-hq",
3
- "version": "13.5.2",
3
+ "version": "13.5.3",
4
4
  "description": "Native Claude Code and Codex session control, history, usage and recoverable local storage for Node.js apps.",
5
5
  "type": "module",
6
6
  "license": "MIT",