@botbotgo/agent-harness 0.0.290 → 0.0.291

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.
Files changed (134) hide show
  1. package/README.md +20 -20
  2. package/README.zh.md +14 -14
  3. package/dist/acp.d.ts +5 -5
  4. package/dist/acp.js +3 -3
  5. package/dist/api.d.ts +20 -21
  6. package/dist/api.js +38 -50
  7. package/dist/cli.js +47 -43
  8. package/dist/config/agents/orchestra.yaml +3 -3
  9. package/dist/config/knowledge/knowledge-runtime.yaml +4 -4
  10. package/dist/config/runtime/runtime-memory.yaml +7 -7
  11. package/dist/config/runtime/workspace.yaml +7 -7
  12. package/dist/contracts/core.d.ts +1 -1
  13. package/dist/contracts/runtime.d.ts +35 -40
  14. package/dist/contracts/workspace.d.ts +2 -2
  15. package/dist/flow/build-flow-graph.js +20 -33
  16. package/dist/flow/export-sequence-mermaid.js +4 -4
  17. package/dist/flow/types.d.ts +2 -2
  18. package/dist/index.d.ts +4 -4
  19. package/dist/index.js +1 -1
  20. package/dist/init-project.js +10 -10
  21. package/dist/knowledge/module.js +37 -45
  22. package/dist/mcp.d.ts +9 -9
  23. package/dist/mcp.js +6 -6
  24. package/dist/package-version.d.ts +1 -1
  25. package/dist/package-version.js +1 -1
  26. package/dist/persistence/file-store.d.ts +69 -69
  27. package/dist/persistence/file-store.js +224 -221
  28. package/dist/persistence/sqlite-request-context-store.d.ts +22 -0
  29. package/dist/persistence/sqlite-request-context-store.js +64 -0
  30. package/dist/persistence/sqlite-request-queue-store.d.ts +41 -0
  31. package/dist/persistence/sqlite-request-queue-store.js +120 -0
  32. package/dist/persistence/sqlite-store.d.ts +72 -72
  33. package/dist/persistence/sqlite-store.js +361 -361
  34. package/dist/persistence/types.d.ts +84 -84
  35. package/dist/protocol/a2a/http.js +79 -74
  36. package/dist/protocol/ag-ui/http.d.ts +7 -7
  37. package/dist/protocol/ag-ui/http.js +20 -20
  38. package/dist/resource/resource-impl.js +1 -1
  39. package/dist/runtime/adapter/compat/deepagent-compat.d.ts +2 -2
  40. package/dist/runtime/adapter/flow/invocation-flow.d.ts +6 -5
  41. package/dist/runtime/adapter/flow/invocation-flow.js +6 -5
  42. package/dist/runtime/adapter/flow/stream-runtime.d.ts +3 -3
  43. package/dist/runtime/adapter/flow/stream-runtime.js +5 -4
  44. package/dist/runtime/adapter/invocation-result.d.ts +6 -5
  45. package/dist/runtime/adapter/invocation-result.js +5 -4
  46. package/dist/runtime/adapter/middleware-assembly.js +3 -2
  47. package/dist/runtime/adapter/tool/tool-hitl.js +1 -1
  48. package/dist/runtime/adapter/upstream-configurable-keys.d.ts +2 -0
  49. package/dist/runtime/adapter/upstream-configurable-keys.js +2 -0
  50. package/dist/runtime/agent-runtime-adapter.d.ts +11 -8
  51. package/dist/runtime/agent-runtime-adapter.js +36 -32
  52. package/dist/runtime/harness/events/events.d.ts +8 -8
  53. package/dist/runtime/harness/events/events.js +25 -19
  54. package/dist/runtime/harness/events/listener-runtime.d.ts +5 -4
  55. package/dist/runtime/harness/events/listener-runtime.js +7 -3
  56. package/dist/runtime/harness/events/runtime-event-operations.d.ts +7 -7
  57. package/dist/runtime/harness/events/runtime-event-operations.js +5 -5
  58. package/dist/runtime/harness/events/streaming.d.ts +8 -7
  59. package/dist/runtime/harness/events/streaming.js +20 -19
  60. package/dist/runtime/harness/events/timeline.js +6 -6
  61. package/dist/runtime/harness/index.d.ts +1 -1
  62. package/dist/runtime/harness/index.js +1 -1
  63. package/dist/runtime/harness/run/helpers.d.ts +14 -11
  64. package/dist/runtime/harness/run/helpers.js +10 -7
  65. package/dist/runtime/harness/run/inspection.d.ts +3 -2
  66. package/dist/runtime/harness/run/inspection.js +7 -7
  67. package/dist/runtime/harness/run/operator-overview.d.ts +2 -2
  68. package/dist/runtime/harness/run/operator-overview.js +18 -17
  69. package/dist/runtime/harness/run/queue-diagnostics.js +6 -6
  70. package/dist/runtime/harness/run/recovery.d.ts +15 -15
  71. package/dist/runtime/harness/run/recovery.js +53 -50
  72. package/dist/runtime/harness/run/resources.d.ts +2 -2
  73. package/dist/runtime/harness/run/resources.js +8 -8
  74. package/dist/runtime/harness/run/resume.d.ts +3 -3
  75. package/dist/runtime/harness/run/resume.js +4 -4
  76. package/dist/runtime/harness/run/routing.d.ts +4 -4
  77. package/dist/runtime/harness/run/routing.js +8 -8
  78. package/dist/runtime/harness/run/run-lifecycle.d.ts +12 -12
  79. package/dist/runtime/harness/run/run-lifecycle.js +26 -26
  80. package/dist/runtime/harness/run/run-operations.d.ts +45 -45
  81. package/dist/runtime/harness/run/run-operations.js +79 -78
  82. package/dist/runtime/harness/run/run-queue.d.ts +8 -8
  83. package/dist/runtime/harness/run/run-queue.js +16 -16
  84. package/dist/runtime/harness/run/run-slot-acquisition.d.ts +32 -32
  85. package/dist/runtime/harness/run/run-slot-acquisition.js +41 -41
  86. package/dist/runtime/harness/run/{thread-records.d.ts → session-records.d.ts} +6 -13
  87. package/dist/runtime/harness/run/{thread-records.js → session-records.js} +14 -60
  88. package/dist/runtime/harness/run/start-run.d.ts +36 -36
  89. package/dist/runtime/harness/run/start-run.js +55 -36
  90. package/dist/runtime/harness/run/startup-runtime.d.ts +9 -9
  91. package/dist/runtime/harness/run/startup-runtime.js +22 -20
  92. package/dist/runtime/harness/run/stream-run.d.ts +18 -18
  93. package/dist/runtime/harness/run/stream-run.js +52 -52
  94. package/dist/runtime/harness/runtime-defaults.d.ts +2 -2
  95. package/dist/runtime/harness/runtime-defaults.js +7 -7
  96. package/dist/runtime/harness/system/health-monitor.d.ts +3 -3
  97. package/dist/runtime/harness/system/health-monitor.js +18 -18
  98. package/dist/runtime/harness/system/mem0-ingestion-sync.d.ts +6 -6
  99. package/dist/runtime/harness/system/mem0-ingestion-sync.js +36 -27
  100. package/dist/runtime/harness/system/runtime-memory-candidates.js +2 -2
  101. package/dist/runtime/harness/system/runtime-memory-manager.d.ts +13 -13
  102. package/dist/runtime/harness/system/runtime-memory-manager.js +41 -38
  103. package/dist/runtime/harness/system/runtime-memory-policy.d.ts +1 -1
  104. package/dist/runtime/harness/system/runtime-memory-policy.js +1 -1
  105. package/dist/runtime/harness/system/runtime-memory-records.d.ts +4 -2
  106. package/dist/runtime/harness/system/runtime-memory-records.js +21 -8
  107. package/dist/runtime/harness/system/runtime-memory-sync.d.ts +6 -6
  108. package/dist/runtime/harness/system/runtime-memory-sync.js +47 -44
  109. package/dist/runtime/harness/system/{thread-memory-sync.d.ts → session-memory-sync.d.ts} +7 -7
  110. package/dist/runtime/harness/system/{thread-memory-sync.js → session-memory-sync.js} +28 -28
  111. package/dist/runtime/harness.d.ts +33 -45
  112. package/dist/runtime/harness.js +273 -291
  113. package/dist/runtime/maintenance/checkpoint-maintenance.js +2 -2
  114. package/dist/runtime/maintenance/file-checkpoint-saver.d.ts +1 -1
  115. package/dist/runtime/maintenance/file-checkpoint-saver.js +6 -6
  116. package/dist/runtime/maintenance/runtime-record-maintenance.d.ts +1 -1
  117. package/dist/runtime/maintenance/runtime-record-maintenance.js +33 -33
  118. package/dist/runtime/maintenance/sqlite-checkpoint-saver.d.ts +1 -1
  119. package/dist/runtime/maintenance/sqlite-checkpoint-saver.js +30 -10
  120. package/dist/runtime/support/harness-support.d.ts +2 -2
  121. package/dist/runtime/support/harness-support.js +7 -7
  122. package/dist/runtime/support/runtime-adapter-options.d.ts +2 -2
  123. package/dist/runtime/support/runtime-adapter-options.js +3 -3
  124. package/dist/runtime/support/runtime-factories.d.ts +2 -2
  125. package/dist/runtime/support/runtime-factories.js +10 -10
  126. package/dist/workspace/agent-binding-compiler.js +3 -3
  127. package/dist/workspace/object-loader.js +1 -1
  128. package/dist/workspace/support/workspace-ref-utils.d.ts +4 -3
  129. package/dist/workspace/support/workspace-ref-utils.js +5 -4
  130. package/package.json +1 -1
  131. package/dist/persistence/sqlite-run-context-store.d.ts +0 -22
  132. package/dist/persistence/sqlite-run-context-store.js +0 -64
  133. package/dist/persistence/sqlite-run-queue-store.d.ts +0 -41
  134. package/dist/persistence/sqlite-run-queue-store.js +0 -120
package/dist/cli.js CHANGED
@@ -18,8 +18,8 @@ function renderUsage() {
18
18
  agent-harness runtime health [--workspace <path>] [--json]
19
19
  agent-harness runtime approvals list [--workspace <path>] [--status <pending|approved|edited|rejected|expired>] [--json]
20
20
  agent-harness runtime approvals watch [--workspace <path>] [--status <pending|approved|edited|rejected|expired>] [--poll-ms <ms>] [--once] [--json]
21
- agent-harness runtime runs list [--workspace <path>] [--agent <agentId>] [--thread <threadId>] [--state <state>] [--json]
22
- agent-harness runtime runs tail [--workspace <path>] [--agent <agentId>] [--thread <threadId>] [--state <state>] [--poll-ms <ms>] [--once] [--json]
21
+ agent-harness runtime requests list [--workspace <path>] [--agent <agentId>] [--session <sessionId>] [--state <state>] [--json]
22
+ agent-harness runtime requests tail [--workspace <path>] [--agent <agentId>] [--session <sessionId>] [--state <state>] [--poll-ms <ms>] [--once] [--json]
23
23
  agent-harness runtime export request --workspace <path> --session <sessionId> --request <requestId> [--artifacts] [--artifact-contents] [--health] [--json]
24
24
  agent-harness runtime export session --workspace <path> --session <sessionId> [--artifacts] [--artifact-contents] [--health] [--json]
25
25
  agent-harness runtime-mcp serve [--workspace <path>]
@@ -168,13 +168,13 @@ function parseRuntimeInspectOptions(args) {
168
168
  let status;
169
169
  let state;
170
170
  let agentId;
171
- let threadId;
171
+ let sessionId;
172
172
  for (let index = 0; index < args.length; index += 1) {
173
173
  const arg = args[index];
174
- if (arg === "--workspace" || arg === "--status" || arg === "--state" || arg === "--agent" || arg === "--thread" || arg === "--poll-ms" || arg === "--limit") {
174
+ if (arg === "--workspace" || arg === "--status" || arg === "--state" || arg === "--agent" || arg === "--session" || arg === "--poll-ms" || arg === "--limit") {
175
175
  const value = args[index + 1];
176
176
  if (!value) {
177
- return { json, once, pollMs, limit, status, state, agentId, threadId, error: `Missing value for ${arg}` };
177
+ return { json, once, pollMs, limit, status, state, agentId, sessionId, error: `Missing value for ${arg}` };
178
178
  }
179
179
  if (arg === "--workspace") {
180
180
  workspaceRoot = value;
@@ -188,20 +188,20 @@ function parseRuntimeInspectOptions(args) {
188
188
  else if (arg === "--agent") {
189
189
  agentId = value;
190
190
  }
191
- else if (arg === "--thread") {
192
- threadId = value;
191
+ else if (arg === "--session") {
192
+ sessionId = value;
193
193
  }
194
194
  else if (arg === "--limit") {
195
195
  const parsedLimit = Number.parseInt(value, 10);
196
196
  if (!Number.isFinite(parsedLimit) || parsedLimit <= 0) {
197
- return { json, once, pollMs, limit, status, state, agentId, threadId, error: `Invalid limit: ${value}` };
197
+ return { json, once, pollMs, limit, status, state, agentId, sessionId, error: `Invalid limit: ${value}` };
198
198
  }
199
199
  limit = parsedLimit;
200
200
  }
201
201
  else {
202
202
  const parsedPoll = Number.parseInt(value, 10);
203
203
  if (!Number.isFinite(parsedPoll) || parsedPoll <= 0) {
204
- return { json, once, pollMs, limit, status, state, agentId, threadId, error: `Invalid poll interval: ${value}` };
204
+ return { json, once, pollMs, limit, status, state, agentId, sessionId, error: `Invalid poll interval: ${value}` };
205
205
  }
206
206
  pollMs = parsedPoll;
207
207
  }
@@ -216,9 +216,9 @@ function parseRuntimeInspectOptions(args) {
216
216
  once = true;
217
217
  continue;
218
218
  }
219
- return { workspaceRoot, json, once, pollMs, limit, status, state, agentId, threadId, error: `Unknown option: ${arg}` };
219
+ return { workspaceRoot, json, once, pollMs, limit, status, state, agentId, sessionId, error: `Unknown option: ${arg}` };
220
220
  }
221
- return { workspaceRoot, json, once, pollMs, limit, status, state, agentId, threadId };
221
+ return { workspaceRoot, json, once, pollMs, limit, status, state, agentId, sessionId };
222
222
  }
223
223
  function parseRuntimeExportOptions(args) {
224
224
  let workspaceRoot;
@@ -321,10 +321,10 @@ function renderHealthSnapshot(snapshot, workspacePath) {
321
321
  }
322
322
  const stats = isObject(snapshot.stats) ? snapshot.stats : {};
323
323
  const statEntries = [
324
- ["activeRunSlots", stats.activeRunSlots],
325
- ["pendingRunSlots", stats.pendingRunSlots],
324
+ ["activeRequestSlots", stats.activeRequestSlots],
325
+ ["pendingRequestSlots", stats.pendingRequestSlots],
326
326
  ["pendingApprovals", stats.pendingApprovals],
327
- ["stuckRuns", stats.stuckRuns],
327
+ ["stuckRequests", stats.stuckRequests],
328
328
  ["llmSuccessRate1m", stats.llmSuccessRate1m],
329
329
  ["llmP95LatencyMs1m", stats.llmP95LatencyMs1m],
330
330
  ]
@@ -359,32 +359,32 @@ function renderApprovalList(approvals) {
359
359
  const status = typeof approval.status === "string" ? approval.status : "unknown";
360
360
  const toolName = typeof approval.toolName === "string" ? approval.toolName : "unknown_tool";
361
361
  const approvalId = typeof approval.approvalId === "string" ? approval.approvalId : "unknown";
362
- const threadId = typeof approval.threadId === "string" ? ` thread=${approval.threadId}` : "";
363
- const runId = typeof approval.runId === "string" ? ` run=${approval.runId}` : "";
362
+ const sessionId = typeof approval.sessionId === "string" ? ` session=${approval.sessionId}` : "";
363
+ const requestId = typeof approval.requestId === "string" ? ` request=${approval.requestId}` : "";
364
364
  const reason = typeof approval.approvalReason === "string" ? ` reason=${approval.approvalReason}` : "";
365
365
  const requestedAt = formatTimestamp(approval.requestedAt);
366
366
  const resolvedAt = formatTimestamp(approval.resolvedAt);
367
367
  const requested = requestedAt ? ` requested=${requestedAt}` : "";
368
368
  const resolved = resolvedAt ? ` resolved=${resolvedAt}` : "";
369
- return `${approvalId} status=${status} tool=${toolName}${threadId}${runId}${reason}${requested}${resolved}`;
369
+ return `${approvalId} status=${status} tool=${toolName}${sessionId}${requestId}${reason}${requested}${resolved}`;
370
370
  }).join("\n") + "\n";
371
371
  }
372
- function renderRunList(runs) {
373
- if (runs.length === 0) {
374
- return "No runs matched.\n";
372
+ function renderRequestList(requests) {
373
+ if (requests.length === 0) {
374
+ return "No requests matched.\n";
375
375
  }
376
- return runs.map((run) => {
377
- const runId = typeof run.runId === "string" ? run.runId : "unknown";
378
- const threadId = typeof run.threadId === "string" ? run.threadId : "unknown";
379
- const agentId = typeof run.agentId === "string" ? run.agentId : "unknown";
380
- const state = typeof run.state === "string" ? run.state : "unknown";
381
- const currentAgent = typeof run.currentAgentId === "string" ? ` current=${run.currentAgentId}` : "";
382
- const resumable = typeof run.resumable === "boolean" ? ` resumable=${run.resumable}` : "";
383
- const updatedAt = formatTimestamp(run.updatedAt);
384
- const lastActivityAt = formatTimestamp(run.lastActivityAt);
376
+ return requests.map((request) => {
377
+ const requestId = typeof request.requestId === "string" ? request.requestId : "unknown";
378
+ const sessionId = typeof request.sessionId === "string" ? request.sessionId : "unknown";
379
+ const agentId = typeof request.agentId === "string" ? request.agentId : "unknown";
380
+ const state = typeof request.state === "string" ? request.state : "unknown";
381
+ const currentAgent = typeof request.currentAgentId === "string" ? ` current=${request.currentAgentId}` : "";
382
+ const resumable = typeof request.resumable === "boolean" ? ` resumable=${request.resumable}` : "";
383
+ const updatedAt = formatTimestamp(request.updatedAt);
384
+ const lastActivityAt = formatTimestamp(request.lastActivityAt);
385
385
  const updated = updatedAt ? ` updated=${updatedAt}` : "";
386
386
  const lastActivity = lastActivityAt ? ` activity=${lastActivityAt}` : "";
387
- return `${runId} thread=${threadId} agent=${agentId}${currentAgent} state=${state}${resumable}${updated}${lastActivity}`;
387
+ return `${requestId} session=${sessionId} agent=${agentId}${currentAgent} state=${state}${resumable}${updated}${lastActivity}`;
388
388
  }).join("\n") + "\n";
389
389
  }
390
390
  function renderOperatorOverview(overview, workspacePath) {
@@ -415,11 +415,11 @@ function renderOperatorOverview(overview, workspacePath) {
415
415
  if (approvalItems.length > 0) {
416
416
  lines.push(renderApprovalList(approvalItems).trimEnd());
417
417
  }
418
- const runs = isObject(overview.runs) ? overview.runs : {};
419
- const runItems = Array.isArray(runs.items) ? runs.items.filter(isObject) : [];
420
- lines.push(`Active runs: ${typeof runs.total === "number" ? runs.total : runItems.length}`);
421
- if (runItems.length > 0) {
422
- lines.push(renderRunList(runItems).trimEnd());
418
+ const requests = isObject(overview.requests) ? overview.requests : {};
419
+ const requestItems = Array.isArray(requests.items) ? requests.items.filter(isObject) : [];
420
+ lines.push(`Active requests: ${typeof requests.total === "number" ? requests.total : requestItems.length}`);
421
+ if (requestItems.length > 0) {
422
+ lines.push(renderRequestList(requestItems).trimEnd());
423
423
  }
424
424
  return `${lines.join("\n")}\n`;
425
425
  }
@@ -654,7 +654,7 @@ export async function runCli(argv, io = {}, deps = {}) {
654
654
  return 1;
655
655
  }
656
656
  }
657
- const nestedCommand = (subcommand === "approvals" || subcommand === "runs") && possibleNestedCommand
657
+ const nestedCommand = (subcommand === "approvals" || subcommand === "requests") && possibleNestedCommand
658
658
  ? possibleNestedCommand
659
659
  : undefined;
660
660
  const subcommandArgs = nestedCommand
@@ -696,20 +696,24 @@ export async function runCli(argv, io = {}, deps = {}) {
696
696
  await runtime.stop();
697
697
  return 0;
698
698
  }
699
- if (subcommand === "runs" && (nestedCommand === "list" || nestedCommand === "tail")) {
700
- const renderRuns = async () => {
701
- const runs = await runtime.listRuns({
699
+ if (subcommand === "requests" && (nestedCommand === "list" || nestedCommand === "tail")) {
700
+ const renderRequests = async () => {
701
+ const listRequests = runtime.listRequests?.bind(runtime);
702
+ if (!listRequests) {
703
+ throw new Error("Runtime does not support request listing");
704
+ }
705
+ const requests = await listRequests({
702
706
  ...(parsed.agentId ? { agentId: parsed.agentId } : {}),
703
- ...(parsed.threadId ? { threadId: parsed.threadId } : {}),
707
+ ...(parsed.sessionId ? { sessionId: parsed.sessionId } : {}),
704
708
  ...(parsed.state ? { state: parsed.state } : {}),
705
709
  });
706
- stdout(parsed.json ? renderJson(runs) : renderRunList(runs));
710
+ stdout(parsed.json ? renderJson(requests) : renderRequestList(requests));
707
711
  };
708
- await renderRuns();
712
+ await renderRequests();
709
713
  if (nestedCommand === "tail" && !parsed.once) {
710
714
  for (;;) {
711
715
  await sleep(parsed.pollMs);
712
- await renderRuns();
716
+ await renderRequests();
713
717
  }
714
718
  }
715
719
  await runtime.stop();
@@ -25,8 +25,8 @@ spec:
25
25
  # Treat this as agent-owned startup context, not as a dynamic long-term memory sink:
26
26
  # - keep `systemPrompt` for stable role, boundaries, and hard behavioral rules
27
27
  # - use `memory:` for stable project knowledge, operating conventions, and shared or agent-specific context files
28
- # - use `/memories/*` via the backend/store below for durable knowledge learned from prior runs
29
- # - use the harness checkpointer for resumable graph state for an in-flight run
28
+ # - use `/memories/*` via the backend/store below for durable knowledge learned from prior requests
29
+ # - use the harness checkpointer for resumable graph state for an in-flight request
30
30
  # Updating these files changes future agent constructions, but they are still bootstrap inputs rather than
31
31
  # self-updating runtime memory.
32
32
  - path: config/agent-context.md
@@ -102,7 +102,7 @@ spec:
102
102
  When the user asks about available tools, skills, or agents, use the attached inventory tools instead of
103
103
  inferring from memory.
104
104
 
105
- Write to `/memories/*` only when the information is durable, reusable across future runs or threads, and likely
105
+ Write to `/memories/*` only when the information is durable, reusable across future requests or sessions, and likely
106
106
  to matter again: user preferences, project conventions, confirmed decisions, reusable summaries, and stable
107
107
  ownership facts are good candidates.
108
108
  Do not store transient reasoning, temporary plans, scratch work, one-off search results, or intermediate
@@ -46,15 +46,15 @@ spec:
46
46
  background:
47
47
  enabled: true
48
48
  scopes:
49
- - thread
49
+ - session
50
50
  stateStorePath: knowledge/formation-state.json
51
- maxMessagesPerRun: 40
51
+ maxMessagesPerRequest: 40
52
52
  writeOnApprovalResolution: true
53
- writeOnRunCompletion: true
53
+ writeOnRequestCompletion: true
54
54
  mem0:
55
55
  ## agent-harness feature: optional Mem0 OSS ingestion defaults for standalone knowledge extraction.
56
56
  enabled: false
57
57
  apiKeyEnv: MEM0_API_KEY
58
58
  appId: agent-harness
59
59
  stateStorePath: knowledge/mem0-sync-state.json
60
- maxMessagesPerRun: 200
60
+ maxMessagesPerRequest: 200
@@ -64,7 +64,7 @@ spec:
64
64
  ingestion:
65
65
  backgroundConsolidation: true
66
66
  writeOnApprovalResolution: true
67
- writeOnRunCompletion: true
67
+ writeOnRequestCompletion: true
68
68
 
69
69
  # agent-harness feature: LangMem-style memory formation defaults for hot-path and background reflection.
70
70
  formation:
@@ -77,14 +77,14 @@ spec:
77
77
  background:
78
78
  enabled: true
79
79
  scopes:
80
- - thread
80
+ - session
81
81
  stateStorePath: knowledge/formation-state.json
82
- maxMessagesPerRun: 40
82
+ maxMessagesPerRequest: 40
83
83
  writeOnApprovalResolution: true
84
- writeOnRunCompletion: true
84
+ writeOnRequestCompletion: true
85
85
 
86
- # agent-harness feature: optional thread snapshot projection for operational state and pending approvals.
87
- threadMemorySync:
86
+ # agent-harness feature: optional session snapshot projection for operational state and pending approvals.
87
+ sessionMemorySync:
88
88
  enabled: true
89
89
 
90
90
  # agent-harness feature: optional Mem0 OSS ingestion engine for automatic long-term knowledge extraction.
@@ -93,4 +93,4 @@ spec:
93
93
  apiKeyEnv: MEM0_API_KEY
94
94
  appId: agent-harness
95
95
  stateStorePath: knowledge/mem0-sync-state.json
96
- maxMessagesPerRun: 200
96
+ maxMessagesPerRequest: 200
@@ -29,8 +29,8 @@ spec:
29
29
  # agent-harness feature: stable runtime profile identifier for this data folder.
30
30
  profile: default
31
31
 
32
- # agent-harness feature: runtime-level task queue and maximum number of concurrent runs.
33
- # Additional runs wait in the harness queue until a slot becomes available.
32
+ # agent-harness feature: runtime-level task queue and maximum number of concurrent requests.
33
+ # Additional requests wait in the harness queue until a slot becomes available.
34
34
  concurrency:
35
35
  maxConcurrentRuns: 3
36
36
 
@@ -60,7 +60,7 @@ spec:
60
60
  # - `regex`: regular-expression match (string or list)
61
61
  # - `minLength` / `maxLength`: request text length bounds
62
62
  # - `minLines` / `maxLines`: request line-count bounds
63
- # - `hasThreadId`: require a new turn (`false`) or existing thread follow-up (`true`)
63
+ # - `hasSessionId`: require a new turn (`false`) or existing session follow-up (`true`)
64
64
  # - `caseSensitive`: default `false`
65
65
  #
66
66
  # Example:
@@ -98,7 +98,7 @@ spec:
98
98
  # coupling cleanup to user-triggered checkpoint reads or writes.
99
99
  #
100
100
  # Current support:
101
- # - terminal runtime-record cleanup for structured thread/run metadata in `runtime.sqlite`
101
+ # - terminal runtime-record cleanup for structured session/request metadata in `runtime.sqlite`
102
102
  # - oldest-first deletion by time policy and/or size policy
103
103
  # - background scheduling inside the harness lifecycle
104
104
  #
@@ -124,17 +124,17 @@ spec:
124
124
  sweepBatchSize: 100
125
125
  vacuum: false
126
126
 
127
- # agent-harness feature: runtime-managed recovery policy for interrupted runs.
127
+ # agent-harness feature: runtime-managed recovery policy for interrupted requests.
128
128
  # This keeps checkpoint resume as an internal lifecycle concern instead of a primary user-facing API concept.
129
129
  #
130
130
  # Current support:
131
- # - startup recovery of runs already in `resuming` state
131
+ # - startup recovery of requests already in `resuming` state
132
132
  # - persisted approval-decision intent for cross-restart resume continuation
133
133
  # - bounded retry attempts to avoid infinite restart loops
134
134
  #
135
135
  recovery:
136
136
  enabled: true
137
- resumeResumingRunsOnStartup: true
137
+ resumeResumingRequestsOnStartup: true
138
138
  maxRecoveryAttempts: 3
139
139
 
140
140
  # agent-harness feature: runtime-managed resilience policy for transient provider failures.
@@ -4,4 +4,4 @@ export type RuntimeCapabilities = {
4
4
  delegation?: boolean;
5
5
  memory?: boolean;
6
6
  };
7
- export type RunState = "queued" | "claimed" | "running" | "waiting_for_approval" | "resuming" | "cancelling" | "cancelled" | "completed" | "failed";
7
+ export type RequestState = "queued" | "claimed" | "running" | "waiting_for_approval" | "resuming" | "cancelling" | "cancelled" | "completed" | "failed";
@@ -1,4 +1,4 @@
1
- import type { RunState } from "./core.js";
1
+ import type { RequestState } from "./core.js";
2
2
  import type { CompiledAgentBinding, CompiledModel, CompiledTool, ParsedAgentObject, ParsedToolObject, WorkspaceBundle } from "./workspace.js";
3
3
  /**
4
4
  * Persisted runtime summary for an inspectable conversation session.
@@ -10,7 +10,7 @@ export type SessionSummary = {
10
10
  latestRequestId: string;
11
11
  createdAt: string;
12
12
  updatedAt: string;
13
- status: RunState;
13
+ status: RequestState;
14
14
  currentAgentId?: string;
15
15
  };
16
16
  /**
@@ -25,9 +25,7 @@ export type SessionListSummary = SessionSummary & {
25
25
  title?: string;
26
26
  snippet?: string;
27
27
  };
28
- export type ThreadSummary = SessionSummary;
29
- export type ThreadListSummary = SessionListSummary;
30
- export type KnownHarnessEventType = "run.created" | "run.queued" | "run.dequeued" | "run.state.changed" | "run.resumed" | "approval.requested" | "approval.resolved" | "artifact.created" | "output.delta" | "runtime.health.changed" | "runtime.synthetic_fallback";
28
+ export type KnownHarnessEventType = "request.created" | "request.queued" | "request.dequeued" | "request.state.changed" | "request.resumed" | "approval.requested" | "approval.resolved" | "artifact.created" | "output.delta" | "runtime.health.changed" | "runtime.synthetic_fallback";
31
29
  export type HarnessEventType = KnownHarnessEventType | (string & {});
32
30
  /**
33
31
  * Persisted runtime event recorded by the harness runtime.
@@ -62,7 +60,7 @@ export type RuntimeTimelineItem = {
62
60
  timestamp: string;
63
61
  sequence: number;
64
62
  source: HarnessEvent["source"];
65
- kind: "run" | "queue" | "approval" | "recovery" | "artifact" | "other";
63
+ kind: "request" | "queue" | "approval" | "recovery" | "artifact" | "other";
66
64
  payload: Record<string, unknown>;
67
65
  };
68
66
  export type RuntimeTimelineProjectionOptions = {
@@ -109,9 +107,9 @@ export type AgentReference = {
109
107
  };
110
108
  export type RuntimeQueueDiagnostics = {
111
109
  status: HealthStatus;
112
- activeRunSlots: number;
113
- pendingRunSlots: number;
114
- stuckRuns: number;
110
+ activeRequestSlots: number;
111
+ pendingRequestSlots: number;
112
+ stuckRequests: number;
115
113
  queueEvents: RuntimeTimelineItem[];
116
114
  summary: string;
117
115
  };
@@ -135,10 +133,10 @@ export type RuntimeOperatorOverview = {
135
133
  total: number;
136
134
  items: ApprovalRecord[];
137
135
  };
138
- runs: {
136
+ requests: {
139
137
  total: number;
140
- states: Partial<Record<RunState, number>>;
141
- items: RunSummary[];
138
+ states: Partial<Record<RequestState, number>>;
139
+ items: RequestSummary[];
142
140
  };
143
141
  governance: RuntimeGovernanceDiagnostics;
144
142
  };
@@ -224,7 +222,7 @@ export type MemoryCandidate = {
224
222
  provenance?: Record<string, unknown>;
225
223
  };
226
224
  export type MemoryKind = "semantic" | "episodic" | "procedural";
227
- export type MemoryScope = "thread" | "agent" | "workspace" | "user" | "project";
225
+ export type MemoryScope = "session" | "agent" | "workspace" | "user" | "project";
228
226
  export type MemoryRecordStatus = "active" | "stale" | "conflicted" | "archived" | "pending_review";
229
227
  export type MemoryDecisionAction = "reject" | "store" | "merge" | "refresh" | "supersede" | "archive" | "review";
230
228
  export type MemoryRecord = {
@@ -399,10 +397,10 @@ export type RuntimeHealthSnapshot = {
399
397
  };
400
398
  symptoms: RuntimeHealthSymptom[];
401
399
  stats: {
402
- activeRunSlots: number;
403
- pendingRunSlots: number;
400
+ activeRequestSlots: number;
401
+ pendingRequestSlots: number;
404
402
  pendingApprovals: number;
405
- stuckRuns: number;
403
+ stuckRequests: number;
406
404
  checkpointBytes?: number;
407
405
  runtimeDbBytes?: number;
408
406
  artifactBytes?: number;
@@ -410,10 +408,10 @@ export type RuntimeHealthSnapshot = {
410
408
  llmP95LatencyMs1m?: number;
411
409
  };
412
410
  };
413
- export type RunResult = {
411
+ export type RequestResult = {
414
412
  sessionId: string;
415
413
  requestId: string;
416
- state: RunState;
414
+ state: RequestState;
417
415
  output: string;
418
416
  finalMessageText?: string;
419
417
  outputContent?: unknown;
@@ -439,7 +437,7 @@ export type RuntimeListeners = {
439
437
  onUpstreamEvent?: (event: UpstreamRuntimeEvent) => void | Promise<void>;
440
438
  onTraceItem?: (item: UpstreamRuntimeEventItem) => void | Promise<void>;
441
439
  };
442
- export type RunListeners = RuntimeListeners;
440
+ export type RequestListeners = RuntimeListeners;
443
441
  export type MessageContentPart = {
444
442
  type: "text";
445
443
  text: string;
@@ -454,23 +452,23 @@ export type InvocationEnvelope = {
454
452
  attachments?: Record<string, unknown>;
455
453
  capabilities?: Record<string, unknown>;
456
454
  };
457
- export type RunStartOptions = {
455
+ export type RequestStartOptions = {
458
456
  agentId?: string;
459
457
  input: MessageContent;
460
458
  sessionId?: string;
461
459
  priority?: number;
462
460
  invocation?: InvocationEnvelope;
463
- listeners?: RunListeners;
461
+ listeners?: RequestListeners;
464
462
  };
465
- export type RunDecisionOptions = {
463
+ export type RequestDecisionOptions = {
466
464
  sessionId: string;
467
465
  requestId?: string;
468
466
  approvalId?: string;
469
467
  decision: "approve" | "edit" | "reject";
470
468
  editedInput?: Record<string, unknown>;
471
- listeners?: RunListeners;
469
+ listeners?: RequestListeners;
472
470
  };
473
- export type RunOptions = RunStartOptions | RunDecisionOptions;
471
+ export type RequestOptions = RequestStartOptions | RequestDecisionOptions;
474
472
  export type HarnessStreamItem = {
475
473
  type: "event";
476
474
  event: HarnessEvent;
@@ -502,7 +500,7 @@ export type HarnessStreamItem = {
502
500
  event: UpstreamRuntimeEvent;
503
501
  } | {
504
502
  type: "result";
505
- result: RunResult;
503
+ result: RequestResult;
506
504
  };
507
505
  export type TranscriptMessage = {
508
506
  role: "user" | "assistant";
@@ -510,16 +508,16 @@ export type TranscriptMessage = {
510
508
  requestId: string;
511
509
  createdAt: string;
512
510
  };
513
- export type ThreadRunRecord = {
511
+ export type SessionRequestRecord = {
514
512
  requestId: string;
515
513
  sessionId: string;
516
514
  agentId: string;
517
- parentRunId?: string;
515
+ parentRequestId?: string;
518
516
  executionMode: string;
519
517
  adapterKind?: string;
520
518
  createdAt: string;
521
519
  updatedAt: string;
522
- state: RunState;
520
+ state: RequestState;
523
521
  checkpointRef: string | null;
524
522
  resumable: boolean;
525
523
  startedAt: string;
@@ -533,13 +531,11 @@ export type ThreadRunRecord = {
533
531
  * Persisted request summary projected from upstream execution state plus runtime lifecycle metadata.
534
532
  * This is the canonical runtime-facing execution record.
535
533
  */
536
- export type RequestSummary = ThreadRunRecord;
534
+ export type RequestSummary = SessionRequestRecord;
537
535
  export type RequestRecord = RequestSummary & {
538
536
  traceItems?: unknown[];
539
537
  runtimeTimeline?: RuntimeTimelineItem[];
540
538
  };
541
- export type RunSummary = RequestSummary;
542
- export type RunRecord = RequestRecord;
543
539
  /**
544
540
  * Persisted session inspection record assembled from runtime records.
545
541
  * This is an inspectable projection, not a second session semantic model.
@@ -548,7 +544,7 @@ export type SessionRecord = {
548
544
  sessionId: string;
549
545
  entryAgentId: string;
550
546
  currentAgentId?: string;
551
- currentState: RunState;
547
+ currentState: RequestState;
552
548
  latestRequestId: string;
553
549
  createdAt: string;
554
550
  updatedAt: string;
@@ -562,7 +558,6 @@ export type SessionRecord = {
562
558
  requestedAt: string;
563
559
  };
564
560
  };
565
- export type ThreadRecord = SessionRecord;
566
561
  export type ResumeOptions = {
567
562
  sessionId?: string;
568
563
  requestId?: string;
@@ -576,7 +571,7 @@ export type CancelOptions = {
576
571
  };
577
572
  export type RestartConversationOptions = {
578
573
  sessionId: string;
579
- mode: "restart-in-thread" | "restart-new-thread";
574
+ mode: "restart-in-session" | "restart-new-session";
580
575
  input: string;
581
576
  };
582
577
  /**
@@ -714,7 +709,7 @@ export type RuntimeEvaluationArtifact = ArtifactRecord & {
714
709
  export type RuntimeEvaluationExport = {
715
710
  session: SessionRecord | null;
716
711
  request: RequestRecord | null;
717
- runRequest: {
712
+ requestInput: {
718
713
  input: MessageContent;
719
714
  invocation?: InvocationEnvelope;
720
715
  priority?: number;
@@ -742,12 +737,12 @@ export type RuntimeEvaluationReplayResult = {
742
737
  invocation?: InvocationEnvelope;
743
738
  sessionId?: string;
744
739
  };
745
- result: RunResult;
740
+ result: RequestResult;
746
741
  assertions: {
747
742
  expectedOutputMatched?: boolean;
748
743
  };
749
744
  };
750
- export type RuntimeRunPackageInput = {
745
+ export type RuntimeRequestPackageInput = {
751
746
  sessionId: string;
752
747
  requestId: string;
753
748
  includeArtifacts?: boolean;
@@ -769,7 +764,7 @@ export type RuntimeGovernanceEvidence = {
769
764
  approvalSummary: RuntimeApprovalSummary;
770
765
  summary: string;
771
766
  };
772
- export type RuntimeRunPackage = {
767
+ export type RuntimeRequestPackage = {
773
768
  session: SessionRecord | null;
774
769
  request: RequestRecord | null;
775
770
  approvals: ApprovalRecord[];
@@ -790,9 +785,9 @@ export type RuntimeSessionPackage = {
790
785
  requests: RequestRecord[];
791
786
  approvals: ApprovalRecord[];
792
787
  transcript: TranscriptMessage[];
793
- runs: RuntimeRunPackage[];
788
+ requestsPackages: RuntimeRequestPackage[];
794
789
  governance: {
795
- runs: Array<{
790
+ requests: Array<{
796
791
  requestId: string;
797
792
  evidence: RuntimeGovernanceEvidence;
798
793
  }>;
@@ -6,7 +6,7 @@ export type ParsedAgentObject = {
6
6
  capabilities?: RuntimeCapabilities;
7
7
  description: string;
8
8
  modelRef: string;
9
- runRoot?: string;
9
+ runtimeRoot?: string;
10
10
  applicationRoot?: string;
11
11
  dataRoot?: string;
12
12
  runtimeProfile?: string;
@@ -266,7 +266,7 @@ export type CompiledAgentBinding = {
266
266
  applicationRoot?: string;
267
267
  dataRoot?: string;
268
268
  runtimeProfile?: string;
269
- runRoot: string;
269
+ runtimeRoot: string;
270
270
  workspaceRoot?: string;
271
271
  capabilities?: RuntimeCapabilities;
272
272
  resilience?: Record<string, unknown>;