@namzu/sdk 12.2.0 → 13.1.0

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 (77) hide show
  1. package/CHANGELOG.md +199 -0
  2. package/dist/bridge/a2a/__tests__/project-is-the-a2a-context.test.d.ts +2 -0
  3. package/dist/bridge/a2a/__tests__/project-is-the-a2a-context.test.d.ts.map +1 -0
  4. package/dist/bridge/a2a/__tests__/project-is-the-a2a-context.test.js +55 -0
  5. package/dist/bridge/a2a/__tests__/project-is-the-a2a-context.test.js.map +1 -0
  6. package/dist/manager/agent/__tests__/an-env-reaches-the-child-it-was-set-for.test.d.ts +2 -0
  7. package/dist/manager/agent/__tests__/an-env-reaches-the-child-it-was-set-for.test.d.ts.map +1 -0
  8. package/dist/manager/agent/__tests__/an-env-reaches-the-child-it-was-set-for.test.js +159 -0
  9. package/dist/manager/agent/__tests__/an-env-reaches-the-child-it-was-set-for.test.js.map +1 -0
  10. package/dist/manager/agent/lifecycle.d.ts +15 -0
  11. package/dist/manager/agent/lifecycle.d.ts.map +1 -1
  12. package/dist/manager/agent/lifecycle.js +103 -26
  13. package/dist/manager/agent/lifecycle.js.map +1 -1
  14. package/dist/public-runtime.d.ts +1 -1
  15. package/dist/public-runtime.d.ts.map +1 -1
  16. package/dist/public-runtime.js +7 -1
  17. package/dist/public-runtime.js.map +1 -1
  18. package/dist/session/__tests__/integration/a-successful-delegation-disposes-its-workspace.test.d.ts +21 -0
  19. package/dist/session/__tests__/integration/a-successful-delegation-disposes-its-workspace.test.d.ts.map +1 -0
  20. package/dist/session/__tests__/integration/a-successful-delegation-disposes-its-workspace.test.js +205 -0
  21. package/dist/session/__tests__/integration/a-successful-delegation-disposes-its-workspace.test.js.map +1 -0
  22. package/dist/session/__tests__/integration/handoff-single-e2e.test.js +14 -5
  23. package/dist/session/__tests__/integration/handoff-single-e2e.test.js.map +1 -1
  24. package/dist/session/errors.d.ts +25 -0
  25. package/dist/session/errors.d.ts.map +1 -1
  26. package/dist/session/errors.js +21 -0
  27. package/dist/session/errors.js.map +1 -1
  28. package/dist/session/handoff/broadcast.d.ts.map +1 -1
  29. package/dist/session/handoff/broadcast.js +10 -5
  30. package/dist/session/handoff/broadcast.js.map +1 -1
  31. package/dist/session/handoff/single.d.ts.map +1 -1
  32. package/dist/session/handoff/single.js +27 -4
  33. package/dist/session/handoff/single.js.map +1 -1
  34. package/dist/store/session/__tests__/a-session-has-one-writer.test.d.ts +2 -0
  35. package/dist/store/session/__tests__/a-session-has-one-writer.test.d.ts.map +1 -0
  36. package/dist/store/session/__tests__/a-session-has-one-writer.test.js +79 -0
  37. package/dist/store/session/__tests__/a-session-has-one-writer.test.js.map +1 -0
  38. package/dist/store/session/__tests__/a-workspace-can-be-configured.test.d.ts +2 -0
  39. package/dist/store/session/__tests__/a-workspace-can-be-configured.test.d.ts.map +1 -0
  40. package/dist/store/session/__tests__/a-workspace-can-be-configured.test.js +149 -0
  41. package/dist/store/session/__tests__/a-workspace-can-be-configured.test.js.map +1 -0
  42. package/dist/store/session/disk.d.ts +4 -2
  43. package/dist/store/session/disk.d.ts.map +1 -1
  44. package/dist/store/session/disk.js +71 -4
  45. package/dist/store/session/disk.js.map +1 -1
  46. package/dist/store/session/memory.d.ts +4 -2
  47. package/dist/store/session/memory.d.ts.map +1 -1
  48. package/dist/store/session/memory.js +53 -4
  49. package/dist/store/session/memory.js.map +1 -1
  50. package/dist/tools/coordinator/agent.d.ts.map +1 -1
  51. package/dist/tools/coordinator/agent.js +7 -0
  52. package/dist/tools/coordinator/agent.js.map +1 -1
  53. package/dist/tools/coordinator/index.d.ts.map +1 -1
  54. package/dist/tools/coordinator/index.js +6 -0
  55. package/dist/tools/coordinator/index.js.map +1 -1
  56. package/dist/types/agent/base.d.ts +22 -0
  57. package/dist/types/agent/base.d.ts.map +1 -1
  58. package/dist/types/session/store.d.ts +80 -1
  59. package/dist/types/session/store.d.ts.map +1 -1
  60. package/package.json +1 -1
  61. package/src/bridge/a2a/__tests__/project-is-the-a2a-context.test.ts +66 -0
  62. package/src/manager/agent/__tests__/an-env-reaches-the-child-it-was-set-for.test.ts +196 -0
  63. package/src/manager/agent/lifecycle.ts +107 -26
  64. package/src/public-runtime.ts +6 -0
  65. package/src/session/__tests__/integration/a-successful-delegation-disposes-its-workspace.test.ts +270 -0
  66. package/src/session/__tests__/integration/handoff-single-e2e.test.ts +14 -5
  67. package/src/session/errors.ts +29 -0
  68. package/src/session/handoff/broadcast.ts +10 -5
  69. package/src/session/handoff/single.ts +27 -4
  70. package/src/store/session/__tests__/a-session-has-one-writer.test.ts +116 -0
  71. package/src/store/session/__tests__/a-workspace-can-be-configured.test.ts +210 -0
  72. package/src/store/session/disk.ts +84 -4
  73. package/src/store/session/memory.ts +66 -4
  74. package/src/tools/coordinator/agent.ts +7 -0
  75. package/src/tools/coordinator/index.ts +6 -0
  76. package/src/types/agent/base.ts +23 -0
  77. package/src/types/session/store.ts +88 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,204 @@
1
1
  # Changelog
2
2
 
3
+ ## 13.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 449d736: A workspace can be configured, listed, and reconfigured.
8
+
9
+ Every Project in existence ran at delegation depth 4 and width 8. The config was
10
+ hardcoded identically in both stores, `CreateProjectParams` was
11
+ `{tenantId, name}`, and there was no way to write one afterwards — so a tenant
12
+ with several workspaces could not give them different limits, which is most of
13
+ what having several workspaces is for.
14
+
15
+ `CreateProjectParams` gains `config`, and `SessionStore` gains `updateProject`
16
+ and `listProjects`.
17
+
18
+ **Only the fields something reads are settable.** `ProjectConfig` declares
19
+ eight; five enforcement sites read two of them. The other six have zero
20
+ production readers — `maxInterventionDepth` included, whose three apparent hits
21
+ are all comments describing a wiring that does not exist. Exposing those would
22
+ make a dead field _easier to set_: a host would configure a retention policy,
23
+ get no error, and believe retention was on. `ProjectConfigInput` is therefore
24
+ exactly `maxDelegationDepth` and `maxDelegationWidth`, and a field joins it in
25
+ the same change that gives it a reader.
26
+
27
+ **Both new store methods are optional.** Widening a store interface is invisible
28
+ to callers and fatal to implementors: a host with its own `SessionStore` should
29
+ not stop compiling because the SDK grew a method. Both stores here implement
30
+ them; callers check.
31
+
32
+ Two decisions worth naming. An update is applied **per field**, so a caller
33
+ raising the width is not silently resetting the depth — including when a key is
34
+ present but `undefined`, which is the shape a caller building an update object
35
+ programmatically produces. And `listProjects` **omits** another tenant's
36
+ projects rather than refusing: a listing is a question about what you own, and
37
+ refusing would confirm that somebody else's project is there. Writing to one
38
+ still throws.
39
+
40
+ `listProjects` returns **oldest first, ties broken by id**. The tie-break is
41
+ load-bearing rather than tidy: `createdAt` has millisecond resolution, several
42
+ workspaces created in one millisecond is ordinary, and without it the rest of
43
+ the order came from the directory. A caller paginating a listing that reorders
44
+ under it sees one project twice and another not at all.
45
+
46
+ Verified live against a real run, not only in tests: a workspace created with
47
+ `maxDelegationWidth: 1` refuses the second concurrent delegation with
48
+ `Delegation capacity exceeded: width 2/1`, and the same workspace at width 5
49
+ runs all four.
50
+
51
+ - c13e7b6: An environment reaches the child it was set for.
52
+
53
+ `AgentManager` builds a delegated child's config on two branches. The
54
+ bare-config branch — taken only when a definition has no `configBuilder` — has
55
+ always carried `env`. The `configBuilder` branch, which is what a host
56
+ registering a real agent actually uses, never stamped it. So a run given an
57
+ environment handed its delegates none of it, and the child ran against whatever
58
+ the ambient defaults were.
59
+
60
+ This is the third field to go the same way. `parentSpan` and `resumeHandler` are
61
+ both stamped after the builder returns, each with a comment saying the builder is
62
+ written by whoever registered the agent and cannot be expected to forward
63
+ something it was never told about. `env` was missed, and it went unnoticed
64
+ because a missing environment does not fail — the child just runs somewhere else.
65
+
66
+ Both delegation surfaces now forward the parent's `ToolContext.env` as a
67
+ `configOverrides.env`, and the manager merges it **per key** rather than
68
+ replacing the map: `configOverrides` is a `Partial`, so assignment would drop
69
+ every key the builder set and the caller did not restate. The override wins per
70
+ key, the same direction it already wins for `model`, `thinking` and `effort`.
71
+
72
+ **Widening worth naming:** a delegating agent's `config.env` now reaches every
73
+ descendant, on both surfaces. That is what setting an environment was for, and
74
+ it is a behaviour change for anyone who had been relying on delegates not
75
+ inheriting one.
76
+
77
+ **`env` is for configuration, not credentials**, and the contract now says so
78
+ where it is declared. The map is copied into every descendant, is readable by
79
+ any tool, and enters a model's context and the run transcript the moment a
80
+ command echoes it — properties of the channel, not a judgement about any
81
+ particular value. A value that authenticates to a host belongs on the brokered
82
+ credential path, where the process holds a placeholder and the value is attached
83
+ at egress.
84
+
85
+ No new field on `ProjectConfig`. It already carries six fields nothing reads,
86
+ and a workspace environment does not need a seventh: the mechanism is the
87
+ environment a run is given, which now actually propagates.
88
+
89
+ ## 13.0.0
90
+
91
+ ### Major Changes
92
+
93
+ - 5aae875: A delegated child releases its workspace when it succeeds, not only when it fails.
94
+
95
+ `AgentManager` had two workspace dispose sites and both were failure paths — the
96
+ non-success branch of `finalizeChild`, and the rollback in `failSubSession`. The
97
+ success branch disposed nothing, so a git worktree provisioned for a delegated
98
+ child outlived the child that used it. `.namzu/worktrees/` grew once per
99
+ successful delegation: the more reliable the workers, the faster it filled,
100
+ which is the opposite of the signal a leak usually gives.
101
+
102
+ Disposal now runs on every terminal path, from one shared place, so the two
103
+ cannot drift apart again.
104
+
105
+ **The archival backstop could not fire either, and now can.**
106
+ `ArchivalManager.archive` resolves a workspace only when `SubSession.workspaceId`
107
+ is set. For a spawn-created sub-session that field was written `null` and never
108
+ updated — `provisionSpawn` kept the ref on an in-memory record and nowhere else
109
+ — so the one persisted record that could have named the leaked worktree said
110
+ there was none. `provisionSpawn` now writes `workspaceRef.id` onto the
111
+ sub-session, inside the same compensating rollback as every other mutation
112
+ there. A sub-session with no provisioned workspace still records `null`; lazy
113
+ provisioning stays legal.
114
+
115
+ Two consequences worth knowing before you take the upgrade:
116
+
117
+ - **A worktree is gone once the child that owned it completes**, and this is the
118
+ breaking part. Reading a child's workspace after a successful delegation
119
+ worked — `AgentManager.getSpawnRecord(taskId).workspaceRef` returned a live
120
+ ref, and the directory then persisted indefinitely because nothing removed
121
+ it. That was the leak, but a host inspecting a worker's artifacts afterwards
122
+ could reasonably have been built on it.
123
+
124
+ There is no host-side replacement, so take what you need from inside the
125
+ child: have the worker write its output where the result can carry it, or
126
+ copy the files out before its run settles. In particular a `subsession_idled`
127
+ listener is **too late** — disposal runs before that event is emitted,
128
+ deliberately, so nothing can reach into a workspace that is already going.
129
+
130
+ - **`archive()` now resolves workspaces for spawn-created sub-sessions.** If you
131
+ pass a `workspaceResolver`, it will start being called on this path, and an
132
+ archive bundle may now carry a `workspace` field where it previously never
133
+ did. The resolver contract is unchanged: return `null` for a ref that is
134
+ unknown or already disposed, which is what it will be for a child that
135
+ finished.
136
+
137
+ ### Minor Changes
138
+
139
+ - fbfb061: A session has one writer, and the store is what enforces it.
140
+
141
+ `Session.ownerVersion` is documented as the compare-and-set counter for handoff
142
+ and nothing enforced it. Both stores overwrote unconditionally, so the only
143
+ check lived in the handoff path — where it compared `source.ownerVersion`
144
+ against the assignment after `blockingRun`, `getProject` and `validateDepth` had
145
+ all awaited in between, which is a snapshot compared against itself. Worse, the
146
+ lock transition wrote `status: 'locked'` at the version it had read, so the
147
+ locked window was invisible: a second handoff holding the same snapshot saw an
148
+ unchanged version, passed the check, and locked the session again. Both
149
+ provisioned a worktree and one silently erased the other.
150
+
151
+ `ThreadStore` has had a working CAS since it was written. `SessionStore` now
152
+ does too.
153
+
154
+ **`updateSession(session, tenantId, expectedOwnerVersion?)`.** Supply it and the
155
+ store compares against the version it HAS STORED — not against the payload,
156
+ which is the caller's stale copy — and throws the new `StaleSessionError`
157
+ instead of writing. Omit it and behaviour is exactly what it was, which is the
158
+ compatibility promise.
159
+
160
+ The parameter is optional deliberately. Widening the interface is invisible to
161
+ callers and harmless to a host implementing its own store; a required parameter
162
+ would break every implementor for a guarantee they can opt into.
163
+
164
+ **The handoff lock now moves the version**, which is what makes it a lock, and
165
+ the commit keeps it rather than taking a second — so a handoff still consumes
166
+ exactly one version and `committedOwnerVersion` is unchanged. Only the
167
+ intermediate state changed, and that is the state that had to become visible.
168
+ Both the single and broadcast paths.
169
+
170
+ `StaleSessionError` is exported. A host that opts into the CAS has to tell
171
+ "somebody else took this session" from any other failure, and string-matching a
172
+ message is not a contract.
173
+
174
+ **In-process only, and stated rather than implied.** `DiskSessionStore` writes
175
+ atomically but its read-compare-write is not a critical section, so two
176
+ processes can still both pass. Closing that needs a lease with an expiry — not a
177
+ PID registry, because a Session is durable and written from hosts where a PID is
178
+ not a checkable fact. The contract says so where a caller will read it.
179
+
180
+ ### Patch Changes
181
+
182
+ - 9b01a9e: A2A's `contextId` is a Project, and now something says so.
183
+
184
+ No behaviour changes. `runToA2ATask` has always bound `contextId` to
185
+ `project_id` and `a2aMessageToCreateRun` has always read it back as
186
+ `projectId`; `ThreadId` appears nowhere in the A2A bridge. What changes is that
187
+ the binding is asserted in both directions, and the documentation stops
188
+ claiming the opposite.
189
+
190
+ `docs/sdk/sessions/a2a-threading.md` opened with "A2A connections attach at the
191
+ Thread level, not the Project level" and presented that as the reason the Thread
192
+ layer is first-class — the single load-bearing justification for a whole
193
+ hierarchy level. The code never did it. The claim survived because nothing
194
+ asserted the actual binding: a doc page and a set of comments agreed with each
195
+ other while the code disagreed with both.
196
+
197
+ The page now states what the bridge does, retracts what it used to say, and
198
+ carries the replacement table for the Thread removal that follows. A test pins
199
+ the binding in both directions so the next version of this cannot drift back
200
+ into prose.
201
+
3
202
  ## 12.2.0
4
203
 
5
204
  ### Minor Changes
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=project-is-the-a2a-context.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-is-the-a2a-context.test.d.ts","sourceRoot":"","sources":["../../../../src/bridge/a2a/__tests__/project-is-the-a2a-context.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,55 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { a2aMessageToCreateRun, runToA2ATask } from '../task.js';
3
+ /**
4
+ * A2A's `contextId` is namzu's **Project**, and this pins it.
5
+ *
6
+ * The docs of record said the opposite for a long time: `a2a-threading.md`
7
+ * opened with "A2A connections attach at the Thread level, not the Project
8
+ * level" and called that the reason the Thread layer is first-class. The code
9
+ * never did it. `runToA2ATask` has always bound `contextId` to `project_id`,
10
+ * `a2aParamsToRunRequest` has always read it back as `projectId`, and
11
+ * `ThreadId` appears nowhere in this bridge.
12
+ *
13
+ * That gap is why this test exists rather than a comment. The claim was load-
14
+ * bearing — it was the single justification for a whole hierarchy level — and
15
+ * it survived for months because nothing asserted the actual binding. An
16
+ * unasserted invariant is a belief, and beliefs are what the prose was made of.
17
+ */
18
+ function wireRun(overrides = {}) {
19
+ return {
20
+ id: 'run_ctx',
21
+ agent_id: 'worker',
22
+ status: 'completed',
23
+ project_id: 'prj_alpha',
24
+ created_at: new Date('2026-08-06').toISOString(),
25
+ ...overrides,
26
+ };
27
+ }
28
+ describe('a2a contextId is the project, in both directions', () => {
29
+ it('maps a run onto a task whose context is its project', () => {
30
+ expect(runToA2ATask(wireRun()).contextId).toBe('prj_alpha');
31
+ });
32
+ it('reads a task context back as the project to run under', () => {
33
+ const request = a2aMessageToCreateRun('worker', {
34
+ contextId: 'prj_beta',
35
+ message: { role: 'user', parts: [{ kind: 'text', text: 'go' }] },
36
+ });
37
+ expect(request.projectId).toBe('prj_beta');
38
+ });
39
+ it('round-trips, so a peer context names a project namzu can run under', () => {
40
+ // The property an interoperating peer actually depends on: the context
41
+ // it was handed is the context it can send back.
42
+ const task = runToA2ATask(wireRun({ project_id: 'prj_gamma' }));
43
+ const request = a2aMessageToCreateRun('worker', {
44
+ contextId: task.contextId,
45
+ message: { role: 'user', parts: [{ kind: 'text', text: 'again' }] },
46
+ });
47
+ expect(request.projectId).toBe('prj_gamma');
48
+ });
49
+ it('leaves the context absent when a run has no project', () => {
50
+ // Absent rather than an empty string: a peer must be able to tell "no
51
+ // context" from "a context named nothing".
52
+ expect(runToA2ATask(wireRun({ project_id: undefined })).contextId).toBeUndefined();
53
+ });
54
+ });
55
+ //# sourceMappingURL=project-is-the-a2a-context.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-is-the-a2a-context.test.js","sourceRoot":"","sources":["../../../../src/bridge/a2a/__tests__/project-is-the-a2a-context.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAG7C,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEhE;;;;;;;;;;;;;;GAcG;AAEH,SAAS,OAAO,CAAC,YAA8B,EAAE;IAChD,OAAO;QACN,EAAE,EAAE,SAAS;QACb,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,WAAW;QACnB,UAAU,EAAE,WAAW;QACvB,UAAU,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE;QAChD,GAAG,SAAS;KACD,CAAA;AACb,CAAC;AAED,QAAQ,CAAC,kDAAkD,EAAE,GAAG,EAAE;IACjE,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC9D,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAChE,MAAM,OAAO,GAAG,qBAAqB,CAAC,QAAQ,EAAE;YAC/C,SAAS,EAAE,UAAU;YACrB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE;SACvD,CAAC,CAAA;QAEX,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC7E,uEAAuE;QACvE,iDAAiD;QACjD,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,WAAW,EAAsB,CAAC,CAAC,CAAA;QACnF,MAAM,OAAO,GAAG,qBAAqB,CAAC,QAAQ,EAAE;YAC/C,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE;SAC1D,CAAC,CAAA;QAEX,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;IAC5C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC9D,sEAAsE;QACtE,2CAA2C;QAC3C,MAAM,CACL,YAAY,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,EAAsB,CAAC,CAAC,CAAC,SAAS,CAC9E,CAAC,aAAa,EAAE,CAAA;IAClB,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=an-env-reaches-the-child-it-was-set-for.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"an-env-reaches-the-child-it-was-set-for.test.d.ts","sourceRoot":"","sources":["../../../../src/manager/agent/__tests__/an-env-reaches-the-child-it-was-set-for.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,159 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { EMPTY_TOKEN_USAGE } from '../../../constants/limits.js';
3
+ import { AgentRegistry } from '../../../registry/agent/definitions.js';
4
+ import { DefaultCapacityValidator } from '../../../session/handoff/capacity.js';
5
+ import { SessionSummaryMaterializer } from '../../../session/summary/materialize.js';
6
+ import { WorkspaceBackendRegistry } from '../../../session/workspace/registry.js';
7
+ import { InMemorySessionStore } from '../../../store/session/memory.js';
8
+ import { InMemoryThreadStore } from '../../../store/thread/memory.js';
9
+ import { ZERO_COST } from '../../../utils/cost.js';
10
+ import { ThreadManager } from '../../thread/lifecycle.js';
11
+ import { AgentManager } from '../lifecycle.js';
12
+ /**
13
+ * A delegate registered the normal way inherited no environment at all.
14
+ *
15
+ * `AgentManager` builds a child's config on two branches. The bare-config
16
+ * branch — taken only when a definition has NO `configBuilder` — has always
17
+ * carried `env`. The `configBuilder` branch, which is what a host registering
18
+ * a real agent actually uses, never stamped it. So a run given an environment
19
+ * handed its delegates none of it.
20
+ *
21
+ * This is the third field to go the same way: `parentSpan` and `resumeHandler`
22
+ * are both stamped after the builder returns, each with a comment saying the
23
+ * builder is written by whoever registered the agent and cannot be expected to
24
+ * forward something it was never told about. `env` was missed, and it went
25
+ * unnoticed because a missing environment does not fail — the child just runs
26
+ * somewhere else.
27
+ *
28
+ * These drive the real `AgentManager` rather than re-implementing the merge.
29
+ * A test that restates the logic proves the logic agrees with itself; what has
30
+ * to hold is that the manager applies it.
31
+ */
32
+ const TENANT = 'tnt_env';
33
+ /** Records the config it is run with, so the assertion is on what shipped. */
34
+ function recordingAgent(seen) {
35
+ return {
36
+ type: 'reactive',
37
+ metadata: {
38
+ id: 'worker',
39
+ name: 'worker',
40
+ version: '1.0.0',
41
+ category: 'general',
42
+ description: 'records its config',
43
+ type: 'reactive',
44
+ capabilities: {},
45
+ },
46
+ async run(_input, config) {
47
+ seen.config = config;
48
+ return {
49
+ runId: 'run_child',
50
+ status: 'completed',
51
+ result: 'ok',
52
+ usage: { ...EMPTY_TOKEN_USAGE },
53
+ cost: { ...ZERO_COST },
54
+ iterations: 1,
55
+ durationMs: 0,
56
+ messages: [],
57
+ };
58
+ },
59
+ async cancel() { },
60
+ getCapabilities() {
61
+ return {};
62
+ },
63
+ };
64
+ }
65
+ /** A definition WITH a configBuilder — the branch that dropped `env`. */
66
+ function definitionWithBuilder(agent, builderEnv) {
67
+ return {
68
+ info: {
69
+ id: 'worker',
70
+ name: 'worker',
71
+ version: '1.0.0',
72
+ category: 'general',
73
+ description: 'a worker',
74
+ tools: [],
75
+ defaults: { model: 'test', tokenBudget: 1_000 },
76
+ },
77
+ typedAgent: agent,
78
+ configBuilder: () => ({
79
+ model: 'test',
80
+ tokenBudget: 1_000,
81
+ timeoutMs: 10_000,
82
+ ...(builderEnv ? { env: builderEnv } : {}),
83
+ }),
84
+ };
85
+ }
86
+ async function spawnWith(options) {
87
+ const seen = {};
88
+ const store = new InMemorySessionStore();
89
+ const threadStore = new InMemoryThreadStore();
90
+ const project = await store.createProject({ tenantId: TENANT, name: 'p' }, TENANT);
91
+ const thread = await threadStore.createThread({ projectId: project.id, title: 't' }, TENANT);
92
+ const parentActor = { kind: 'agent', agentId: 'sup', tenantId: TENANT };
93
+ const parentSession = await store.createSession({ threadId: thread.id, projectId: project.id, currentActor: parentActor }, TENANT);
94
+ await store.updateSession({ ...parentSession, status: 'active' }, TENANT);
95
+ const registry = new AgentRegistry();
96
+ registry.register(definitionWithBuilder(recordingAgent(seen), options.builderEnv));
97
+ let n = 0;
98
+ const manager = new AgentManager(registry, undefined, {
99
+ sessionStore: store,
100
+ threadManager: new ThreadManager({ threadStore, sessionStore: store }),
101
+ workspaceRegistry: new WorkspaceBackendRegistry(),
102
+ capacity: new DefaultCapacityValidator(store),
103
+ summaryMaterializer: new SessionSummaryMaterializer({
104
+ store,
105
+ generateSummaryId: () => `sum_${++n}`,
106
+ }),
107
+ });
108
+ const context = {
109
+ parentRunId: 'run_parent',
110
+ parentAgentId: 'sup',
111
+ parentAbortController: new AbortController(),
112
+ depth: 0,
113
+ budgetTracker: { total: 100_000, remaining: 100_000 },
114
+ tenantId: TENANT,
115
+ threadId: thread.id,
116
+ sessionId: parentSession.id,
117
+ projectId: project.id,
118
+ parentActor,
119
+ };
120
+ const task = await manager.sendMessage({
121
+ agentId: 'worker',
122
+ input: { messages: [], workingDirectory: '/tmp' },
123
+ parentSessionId: parentSession.id,
124
+ tenantId: TENANT,
125
+ projectId: project.id,
126
+ parentActor,
127
+ ...(options.overrideEnv ? { configOverrides: { env: options.overrideEnv } } : {}),
128
+ }, context);
129
+ await manager.waitForCompletion(task.taskId);
130
+ return seen.config;
131
+ }
132
+ describe('an environment survives a configBuilder that never heard of it', () => {
133
+ it('reaches a child whose builder sets none', async () => {
134
+ const config = await spawnWith({ overrideEnv: { API_BASE: 'https://staging' } });
135
+ expect(config?.env).toEqual({ API_BASE: 'https://staging' });
136
+ });
137
+ it('keeps the builder keys the caller did not restate', async () => {
138
+ // Why this is a merge and not an assignment: `configOverrides` is a
139
+ // Partial, so replacing the map would drop everything the builder set,
140
+ // and a caller overriding one variable is not saying the rest should
141
+ // vanish.
142
+ const config = await spawnWith({
143
+ builderEnv: { REGION: 'eu', TIER: 'free' },
144
+ overrideEnv: { TIER: 'paid' },
145
+ });
146
+ expect(config?.env).toEqual({ REGION: 'eu', TIER: 'paid' });
147
+ });
148
+ it('leaves the builder environment alone when nothing overrides it', async () => {
149
+ const config = await spawnWith({ builderEnv: { REGION: 'eu' } });
150
+ expect(config?.env).toEqual({ REGION: 'eu' });
151
+ });
152
+ it('gives a child with no environment undefined rather than an empty map', async () => {
153
+ // An agent that never had an environment must not gain an empty object
154
+ // that every reader then has to tell apart from a real one.
155
+ const config = await spawnWith({});
156
+ expect(config?.env).toBeUndefined();
157
+ });
158
+ });
159
+ //# sourceMappingURL=an-env-reaches-the-child-it-was-set-for.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"an-env-reaches-the-child-it-was-set-for.test.js","sourceRoot":"","sources":["../../../../src/manager/agent/__tests__/an-env-reaches-the-child-it-was-set-for.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,EAAE,aAAa,E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AC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gEAAgE,EAAE,KAAK,IAAI,EAAE;QAC/E,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;QAEhE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;IAC9C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,sEAAsE,EAAE,KAAK,IAAI,EAAE;QACrF,uEAAuE;QACvE,4DAA4D;QAC5D,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,EAAE,CAAC,CAAA;QAElC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,aAAa,EAAE,CAAA;IACpC,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -129,6 +129,21 @@ export declare class AgentManager {
129
129
  private markCompleted;
130
130
  private markFailed;
131
131
  private failSubSession;
132
+ /**
133
+ * Release the workspace this manager provisioned for a child.
134
+ *
135
+ * Called on every terminal path, success included. `has(backend)` before
136
+ * `get(backend)` because the registry is deny-by-default and throws on an
137
+ * unknown kind — a driver deregistered mid-run must not turn cleanup into
138
+ * an exception on a child that already finished.
139
+ *
140
+ * Never throws. Disposal is cleanup, not part of the child's result: the
141
+ * sub-session state is already persisted by the time this runs, and
142
+ * failing here would report a delegation that worked as one that did not.
143
+ * The failure is logged instead, because a worktree that could not be
144
+ * removed is an operator's problem and silence is how it stays one.
145
+ */
146
+ private disposeChildWorkspace;
132
147
  private markCanceled;
133
148
  private updateState;
134
149
  private requireInstance;
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/manager/agent/lifecycle.ts"],"names":[],"mappings":"AAE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