diff options
| author | Agando <roduccomm@gmail.com> | 2026-11-02 20:55:56 +0100 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-11-02 20:55:56 +0100 |
| commit | 5427042d86f8e6a08a684a0315932c306472e7f8 (patch) | |
| tree | 71545b39fd8f3839508216af043aa031651fc345 /modules/core/module-memory-graph.js | |
| parent | c72164911cdf416c50130191f7ffc05f54adcc7b (diff) | |
perf(newos4): delegated agent runs no longer serialise; a waiter can't steal a lock
Closes the second half of STEER-20261102-201045-ab08.
- chat() gated the main-turn lock on nothing, so orchestrate-parallel's fan-out
(each sub-task calling chat() on the same instance with its own agentTag) ran
strictly one at a time. Measured 2x300ms delegated runs: 617ms before, 306ms
now; the two 200ms user turns still take 400ms (main path stays serialised).
- the 10s lock timeout called this._chatLock = false and printed "force
released", which cleared a lock the waiter did not own - that released the
main turn's lock while it was still running. A waiter now throws and the owner
is the only writer.
- delegated runs no longer clear the user's cancel flag on entry (an agent start
used to reset this._cancelled, disarming a Stop the user had pressed).
- tool-log entries carry the run they belong to and _recentToolLog(tag, n) is
what feeds the run log line and _postRunReview, so concurrent runs no longer
consume each other's entries.
Known limit, unchanged: _currentTag is a single field, so under true concurrency
an entry can be attributed to the wrong run (telemetry only - the answers are
per-session). Namespacing it properly needs per-call state threading.
Test: modules/test/test-chat-concurrency.js, 7 assertions, RED before
(H1 617ms, H3 force-released, H5 no tags) and GREEN now; maintain 24/24.
Diffstat (limited to 'modules/core/module-memory-graph.js')
0 files changed, 0 insertions, 0 deletions