@bastani/atomic 0.9.38-alpha.9 → 0.9.38
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 +106 -0
- package/dist/builtin/intercom/CHANGELOG.md +10 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +10 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/CHANGELOG.md +7 -0
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +60 -0
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +5 -0
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +57 -15
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/queued-input-admission.d.ts +20 -0
- package/dist/core/queued-input-admission.d.ts.map +1 -0
- package/dist/core/queued-input-admission.js +55 -0
- package/dist/core/queued-input-admission.js.map +1 -0
- package/dist/extensions/mcp/client/transports/streamable-http.js +9 -8
- package/dist/extensions/mcp/client/transports/streamable-http.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.d.ts +4 -0
- package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.js +104 -30
- package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.js +1 -0
- package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.d.ts +4 -0
- package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.js +4 -0
- package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +4 -3
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +8 -2
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +4 -0
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +4 -0
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-process-lifecycle.js +8 -2
- package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
- package/dist/modes/interactive/interactive-queueing.js +94 -73
- package/dist/modes/interactive/interactive-queueing.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +1 -0
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/docs/usage.md +2 -0
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,112 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.38] - 2026-10-18
|
|
6
|
+
|
|
7
|
+
### Breaking Changes
|
|
8
|
+
|
|
9
|
+
- Workflow discovery now uses only `.atomic` default roots, and discovered modules use `@bastani/atomic/workflows` with `typebox`. Removed deprecated workflow API stubs, separate reasoning authoring fields, old stage-target and X10 mouse input formats, and replay without current topology, replay keys, or child exit tags. Use model strings such as `provider/model:high` for reasoning effort. Workflow results, inspection details and status summaries always include their tool collections. Queued stage delivery requires persisted admission order.
|
|
10
|
+
- Workflow heartbeat records require their original launch cadence instead of inheriting the current definition when cadence is missing. Configuration load results always include their global and project source fields, using `null` for absent or invalid sources.
|
|
11
|
+
- Workflow run snapshots require `toolNodes`, and inline forms require injected keybindings without obsolete submit-choice state. Removed the ignored workflow text-truncation `preserveAnsi` argument; ANSI-aware rendering is unchanged.
|
|
12
|
+
- Workflow runs now persist only in the local SQLite journal. Journal initialization failures throw `StorageUnavailableError` instead of continuing without durable storage. Postgres connection settings (`workflows.durability.systemDatabaseUrl` and `workflows.durability.poolSize`) and `DBOS_SYSTEM_DATABASE_URL`, `ATOMIC_POSTGRES_*`, and `PG*` environment variables no longer configure workflow storage.
|
|
13
|
+
- Removed automatic session-format migrations and the `migrateSessionEntries` export. Reading session files no longer appends missing newlines.
|
|
14
|
+
- Removed the workflow `durability` option, `WorkflowDurability`, and `WorkflowDurabilityRequiredError`. Use `RunOpts.journal` to select storage or isolate runs, and handle typed journal errors when storage is unavailable.
|
|
15
|
+
- Removed `InMemoryDurableBackend` and `createInMemoryTestBackend`. Use `JournalDurableBackend` over `MemoryRunJournal` for an explicitly in-memory backend. Removed the `legacyRecovery` workflow-tool argument and remaining `workflows.durability` settings.
|
|
16
|
+
- Removed the `@bastani/workflows` import alias; import workflow APIs from `@bastani/atomic/workflows`.
|
|
17
|
+
- Custom `RunJournal` implementations must provide atomic `deleteOwnedRun(lease)`, and invocation records require `invocationFingerprint`.
|
|
18
|
+
- `SessionManager.create`, `open`, `continueRecent`, `forkFrom`, and mutations now return promises. Await session writes, branch changes, labels, names, and model/thinking changes before reading their results or continuing dependent work. Extension `pi.appendEntry`, `pi.setSessionName`, `pi.setLabel`, and `pi.setThinkingLevel` must also be awaited. Persistent session creation writes its header immediately, and setup entries commit without waiting for the first message. A failed write rejects that call with its typed storage error without publishing the failed entry; there is no `flush` API. Explicit in-memory sessions remain available synchronously through `SessionManager.inMemory()`.
|
|
19
|
+
- Session headers use the format-4 fields `createdAt` and `parentSessionId`, including the header returned by `SessionManager.getHeader()`. The `timestamp` and `parentSession` header fields are removed.
|
|
20
|
+
- Extension provider registration and removal now return promises too: await `pi.registerProvider`, `pi.registerProviderAlias`, and `pi.unregisterProvider` before dependent model or session work.
|
|
21
|
+
- Workflow SQLite journals now use `SqlRunJournal` with async initialization and `wf_` table names. Use `await openSqlRunJournal(pathOrDatabase?)` or `await SqlRunJournal.open(database, { prefix })`, and await `resolveRunJournal`. Earlier unreleased bare tables are not read or migrated. Workflow `StorageUnavailableError` now provides `adapter`, `location`, and `cause` instead of `path`.
|
|
22
|
+
- Session selection now uses IDs instead of file paths: `--session` and `--fork` accept exact IDs or unique eight-hex UUID prefixes; use `--import <file>` for format-4 JSONL exports. Extension `switchSession` takes an ID, lifecycle events use `previousSessionId` and `targetSessionId`, and RPC `switch_session` takes `sessionId`. RPC state reports `sessionLocation` for optional display instead of `sessionFile`. Shell tools no longer expose `ATOMIC_SESSION_FILE` or `PI_SESSION_FILE`; use `ATOMIC_SESSION_ID` or `PI_SESSION_ID`.
|
|
23
|
+
- `RunOpts.journal.database` now takes an async `SqliteDatabase` facade, not a raw `node:sqlite` connection; use `wrapNodeSqliteDatabase` for an existing connection. Journal configuration failures now use `StorageConfigError` with `source`, `field`, and `reason` instead of `JournalConfigurationError`.
|
|
24
|
+
- Workflow stage forks now take `forkFromSessionId`, and stage resume, retained chat, and subagent forks resolve IDs within the selected session store. File paths are not session identities. Embedded chat hosts must use `await host.loadSession(store, sessionId)` instead of `loadSessionFile(path)`.
|
|
25
|
+
- Sessions now default to the local SQLite database shared with workflow runs, rather than JSONL files. JSONL must be selected explicitly. Removed the `sessionDir` setting without an alias; use `sessions.storage.dir` instead.
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- Added a guide to running local models on NVIDIA RTX GPUs with llama.cpp, including recipe prerequisites, router preset conversion, and connecting Atomic.
|
|
30
|
+
- Changing the thinking level mid-session on OpenAI GPT-6 models with an API key now preserves the prompt cache ([#10853](https://github.com/earendil-works/pi/issues/10853)).
|
|
31
|
+
- Added `formatReadLineRange` to the SDK exports so extensions can render `read` line-range labels the same way Atomic does.
|
|
32
|
+
- Added the async SQLite facade and node adapter through `@bastani/atomic/storage`, with typed storage errors, prefix and schema-version helpers, and an adapter conformance suite in `@bastani/atomic/storage/testing`. String bindings containing NUL are rejected with `StorageInvalidTextError`; zero bytes remain supported in binary values.
|
|
33
|
+
- Added the `workflows.journal.path` and `workflows.journal.memory` settings, plus SDK `RunOpts.journal` for a file, caller-owned SQLite connection, explicit memory journal, or supplied journal. TUI, CLI, background, and SDK runs use the selected journal. Relative settings paths resolve against the Atomic home directory.
|
|
34
|
+
- Added `ctx.sessionSignal` so extension commands can close long-running resources when reload or shutdown begins, before admitted work is drained. Custom UI is now dismissed automatically at that boundary while preserving caller-signal cancellation.
|
|
35
|
+
- Added `wrapNodeSqliteDatabase(connection)` for caller-owned connections and facade-backed workflow journals that can share a database with the session store or use a user-supplied SQLite-compatible driver.
|
|
36
|
+
- Added user-installed journal adapter modules, environment/file secret references, shared `storage` defaults, and `StorageProvider` for explicit session/journal opens with shared database lifetime. `RunOpts.journal.database` accepts an async SQLite facade; invalid selections raise `StorageConfigError` without falling back to memory.
|
|
37
|
+
- Added `sessions.storage` and SDK `sessionStore` to select SQLite, explicit JSONL or memory, a caller-owned database, or a user-installed adapter. Shared `storage` settings now configure sessions too; SDK, CLI and environment overrides take precedence without merging selections. Store-open failures raise typed errors rather than falling back to memory.
|
|
38
|
+
- Added `--session-store <path>` and `--session-prefix <prefix>` to select a SQLite session database from the CLI. SQLite resume hints and Herdr commands always include `--session-store` and include `--session-prefix` when non-default.
|
|
39
|
+
- Added a Models Configuration reference generated from the `models.json` schema, listing provider, model, model override, and compatibility fields ([#10790](https://github.com/earendil-works/pi/issues/10790)).
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- The storage adapter conformance suite now checks call-time binary binding inside transactions.
|
|
44
|
+
- Node SQLite facade transactions opened on the same file now queue asynchronously within a process, including when paths use symlinks, instead of stalling the event loop and failing with a locked database.
|
|
45
|
+
- Changed the default NVIDIA model to `nvidia/nemotron-3.5-super-vl-120b-a12b` ([#10910](https://github.com/earendil-works/pi/pull/10910) by [@cv](https://github.com/cv)).
|
|
46
|
+
- Subagent parallel task limits can now be raised above 50 with `parallel.maxTasks`. Configure `parallel.concurrency` and the new `parallel.runningCapacity` together to run more than four child turns per parent; defaults remain 50 tasks, concurrency 3, and running capacity 4.
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
|
|
50
|
+
- Fixed resumed sessions dropping built-in tools activated during the session or reactivating tools that had been disabled. Default tool selections now restore the recorded loadout, with `--tools +name`/`-name` modifiers applied. Explicit tool selections and exclusions remain authoritative ([#10785](https://github.com/earendil-works/pi/issues/10785)).
|
|
51
|
+
- Fixed `read` line-range labels for numeric-string or null `offset`/`limit` arguments, such as those in sessions recorded with offset-based `read` tools, in the session tree, HTML exports, and the subagent example ([#9887](https://github.com/earendil-works/pi/issues/9887)).
|
|
52
|
+
- Fixed prompt templates dropping empty quoted arguments (`""` or `''`), which shifted later positional arguments and prevented positional defaults from applying ([#10867](https://github.com/earendil-works/pi/issues/10867)).
|
|
53
|
+
- Fixed `--model` choosing a provider by catalog order when several providers offer the match; Atomic now prefers the provider with credentials and otherwise reports the ambiguity. `--models` and `enabledModels` add a model for each provider that offers it and warn about the ambiguity. `--api-key` no longer lets stored credentials pick the provider, so a bare model ID offered by several providers needs `provider/model` alongside it, and a bare ID in `modelRouting.allowedModels` or `excludedModels` now covers every provider that offers it ([#10160](https://github.com/earendil-works/pi/issues/10160)).
|
|
54
|
+
- Fixed forked workflow stages and subagents losing their own tools when inheriting conversation history, and deferred startup reactivating extension tools disabled in a resumed session. Completing project-trust startup preserves the recorded selection and deliberate tool changes made by `session_start` handlers ([#3624](https://github.com/bastani-inc/atomic/pull/3624)).
|
|
55
|
+
- Fixed malformed tool-call arguments being executed or losing their original parse error in npm installations. Invalid calls now fail before argument preparation and schema validation, including tools whose arguments are all optional ([#3624](https://github.com/bastani-inc/atomic/pull/3624)).
|
|
56
|
+
- Fixed turns failing after about 14 seconds of Cloudflare 520-524 responses or connection resets. Agent-level retries now wait as long as the server asks through `Retry-After` headers or a Cloudflare `retry_after` body field, capped by `retry.provider.maxRetryDelayMs` (60s), and still stop after `retry.maxRetries`. Without a hint the 2s/4s/8s backoff is unchanged. Switching to a configured fallback model can therefore take up to about `retry.maxRetries` × 60s ([#3623](https://github.com/bastani-inc/atomic/issues/3623))
|
|
57
|
+
- Fixed running sessions retaining stale `auth.json` credentials and login status after another window signs in, logs out, or refreshes a token, including extension OAuth providers. Chat requests rejected for invalid credentials reread the store and retry once when newer credentials are available ([#3620](https://github.com/bastani-inc/atomic/issues/3620)).
|
|
58
|
+
- Fixed the OSC 7501 terminal program status showing `working` instead of `blocked` while the main chat waits on an `ask_user_question` prompt. It now reports `blocked` (`kind=question`) while the questionnaire is open and returns to `working` after you answer, matching workflow-stage prompts ([#3616](https://github.com/bastani-inc/atomic/issues/3616)).
|
|
59
|
+
- Fixed workflow approval gates (a run-level `ctx.ui.confirm`) reporting OSC 7501 `blocked` with `kind=question`. They now report `kind=permission`, so terminals can tell an approval apart from a typed question ([#3618](https://github.com/bastani-inc/atomic/issues/3618)).
|
|
60
|
+
- Fixed paused and cancelled workflow runs reporting OSC 7501 `done`. A paused or cancelled run now reports `idle`, and `done` is reserved for a successful completion ([#3617](https://github.com/bastani-inc/atomic/issues/3617)).
|
|
61
|
+
- Fixed the OSC 7501 status disappearing mid-run in terminals that drop it when transcript rendering emits a prompt mark. The reporter now re-sends its current status after the workflow graph and stage-chat overlay render, restoring the status during a run ([#3615](https://github.com/bastani-inc/atomic/issues/3615)).
|
|
62
|
+
- Fixed Xiaomi MiMo and all regional Token Plan providers defaulting to a deprecated model omitted from the generated catalog. They now select MiMo V2.6 Pro (`mimo-v2.6-pro`) by default.
|
|
63
|
+
- Fixed failed prompts sent after compaction dropping messages queued while the prompt was pending. Later steering, follow-up, and compaction messages now survive recovery without duplicating the original batch ([#3654](https://github.com/bastani-inc/atomic/issues/3654)).
|
|
64
|
+
- Fixed compaction file lists omitting hashline edits, including multi-file edits and nested tool calls. Edited files now appear under modified files rather than read-only files ([#3656](https://github.com/bastani-inc/atomic/issues/3656)).
|
|
65
|
+
- Fixed reordering filtered scoped models crashing or selecting a different model instead of saving the new order ([#3657](https://github.com/bastani-inc/atomic/issues/3657)).
|
|
66
|
+
- Fixed overlapping prompts duplicating deferred shell results in session history, and retries replaying results that were already saved.
|
|
67
|
+
- Fixed new and branched sessions becoming unwritable when a resumed session uses a different destination session directory.
|
|
68
|
+
- Fixed tree label edits appearing saved before persistence completed. Failed saves now display the error and keep the editor open for retry.
|
|
69
|
+
- Fixed failed custom-message writes dropping accepted pending and next-turn messages. Retries now retain the uncommitted messages in order, and overlapping drains do not duplicate saved messages.
|
|
70
|
+
- Fixed overlapping model, thinking-level and session-name changes losing later choices. Model and thinking cycles now advance once per request, and saved defaults retain the last choice.
|
|
71
|
+
- Fixed history refresh failures after a turn escaping error handling. The interactive engine now displays the failure without an unhandled rejection, and label edits await their saved history before reporting success.
|
|
72
|
+
- Renaming the active session in the selector writes through its active manager, so later session writes retain the correct sequence.
|
|
73
|
+
- Session pickers keep selection and rename bound to the selected project's store when IDs repeat across projects. Imported empty session IDs remain persistent across resume and restart instead of starting a new conversation.
|
|
74
|
+
- Fixed Alt+Y restoring stale text and moving the cursor before the start of the scoped-model search after clearing it with Ctrl+C ([#3668](https://github.com/bastani-inc/atomic/issues/3668)).
|
|
75
|
+
- Fixed MCP tools with colliding generated names overwriting another tool's owner. Generated names now avoid names already in use or reserved by other tools ([#3667](https://github.com/bastani-inc/atomic/issues/3667)).
|
|
76
|
+
- Fixed extension input dialogs ignoring the supplied placeholder. The hint now appears while the input is empty without becoming submitted text ([#3672](https://github.com/bastani-inc/atomic/issues/3672)).
|
|
77
|
+
- Session shutdown and replacement now wait for already-admitted extension session entries to finish saving before releasing their resources.
|
|
78
|
+
- Storage providers now preserve domain-adapter prefixes, make returned stores safe to close repeatedly, and retain typed opening errors when cleanup also fails.
|
|
79
|
+
- Fixed sessions written before format 4 disappearing from `/resume` and failing to open with `--continue`, `--session`, or `--fork`. Older supported sessions now upgrade automatically when opened; listing leaves their files unchanged.
|
|
80
|
+
- Fixed session stores closing during conversation replacement or remaining open after CLI shutdown and failed startup. Project storage settings now take effect on first trust approval, JSONL resume commands retain their directory, and SQLite sessions keep full URL-read artifacts.
|
|
81
|
+
- Fixed stopping a codemode script or reaching its deadline waiting for a non-interruptible built-in to return in the standalone binary ([#10748](https://github.com/earendil-works/pi/issues/10748)).
|
|
82
|
+
- Fixed repeated codemode timeouts or aborts accumulating surviving workers. At most two codemode workers may be alive across all sessions, and a cancelled worker counts against that limit until it actually exits ([#10748](https://github.com/earendil-works/pi/issues/10748)).
|
|
83
|
+
- Fixed sessions in symlinked project directories, including macOS temporary directories, being omitted from session lookup or mistaken for sessions from another project.
|
|
84
|
+
- Fixed compaction fallback and branch summaries failing with "generation hit the token cap" when reasoning used most of a fixed output budget. The provider now sizes summary output, and `compaction.reserveTokens` only controls when automatic compaction starts ([#9512](https://github.com/earendil-works/pi/issues/9512), [#9075](https://github.com/earendil-works/pi/issues/9075)).
|
|
85
|
+
- Fixed `models.schema.json` missing descriptions for provider and model fields, so editors now show hints for them ([#10790](https://github.com/earendil-works/pi/issues/10790)).
|
|
86
|
+
- Fixed sessions saved before the SQLite default disappearing from `/resume` and failing to open with `--continue`, `--session`, or `--fork`. With the default store, sessions in `~/.atomic/agent/sessions`, including workflow stage sessions and early 0.9.38 alpha sessions that use a `timestamp` header, are listed alongside newer ones and copied into the database only when you open one, so startup does no extra work. Original files are left untouched, deleted sessions stay deleted, and explicitly selected stores do not show them.
|
|
87
|
+
- Fixed slow interactive startup on machines with many sessions saved before the SQLite default, a follow-up to [#3721](https://github.com/bastani-inc/atomic/pull/3721). Opening a session by its exact ID, which the interactive engine does at launch, now looks up only that session instead of scanning `~/.atomic/agent/sessions`. `/resume`, `--resume`, and `--continue` list unconverted sessions larger than 32 KiB from their first message and most recent entries rather than parsing every file, so their message count is a lower bound and `/resume` search sees only that text until you open one, which still converts it in full.
|
|
88
|
+
- Fixed `/resume` and `--resume` filling up with "(no messages)" sessions. The picker now hides sessions that have no messages, name, or summary, including ones already saved by earlier versions. Opening such a session by ID still works.
|
|
89
|
+
- Fixed MCP Streamable HTTP servers that keep closing their GET event stream without sending event IDs causing endless reconnects. Only a new event ID or a stream that stays open resets the reconnect budget, so `reconnect.maxRetries` now bounds these reconnects ([#3729](https://github.com/bastani-inc/atomic/issues/3729)).
|
|
90
|
+
- Fixed queued steering and follow-up messages being reordered when an extension's async `input` hook takes longer for an earlier message than a later one. Each queue now keeps submission order. Extension commands, extension-sent messages, and messages sent from inside an `input` hook are still delivered immediately ([#3590](https://github.com/bastani-inc/atomic/issues/3590)).
|
|
91
|
+
- Fixed messages queued during compaction coming back out of order when the first one fails to send. The failed message stays at the front of the queue, followed by the rest of its batch and then anything you typed afterwards, both for **ALT+Up** retrieval and when they are sent again. This also applies to workflow stage chats ([#3664](https://github.com/bastani-inc/atomic/issues/3664)).
|
|
92
|
+
|
|
93
|
+
### Removed
|
|
94
|
+
|
|
95
|
+
- Removed DBOS, embedded Postgres, their bundled runtimes and native process ownership, and the non-durable storage fallback. Server-specific admission, recovery, outage handling, and deferred persistence queues are gone; workflow pause, resume, quit, answer, and checkpoint replay remain supported.
|
|
96
|
+
|
|
97
|
+
## [0.9.38-alpha.11] - 2026-10-17
|
|
98
|
+
|
|
99
|
+
### Fixed
|
|
100
|
+
|
|
101
|
+
- Fixed MCP Streamable HTTP servers that keep closing their GET event stream without sending event IDs causing endless reconnects. Only a new event ID or a stream that stays open resets the reconnect budget, so `reconnect.maxRetries` now bounds these reconnects ([#3729](https://github.com/bastani-inc/atomic/issues/3729)).
|
|
102
|
+
- Fixed queued steering and follow-up messages being reordered when an extension's async `input` hook takes longer for an earlier message than a later one. Each queue now keeps submission order. Extension commands, extension-sent messages, and messages sent from inside an `input` hook are still delivered immediately ([#3590](https://github.com/bastani-inc/atomic/issues/3590)).
|
|
103
|
+
- Fixed messages queued during compaction coming back out of order when the first one fails to send. The failed message stays at the front of the queue, followed by the rest of its batch and then anything you typed afterwards, both for **ALT+Up** retrieval and when they are sent again. This also applies to workflow stage chats ([#3664](https://github.com/bastani-inc/atomic/issues/3664)).
|
|
104
|
+
|
|
105
|
+
## [0.9.38-alpha.10] - 2026-10-17
|
|
106
|
+
|
|
107
|
+
### Fixed
|
|
108
|
+
|
|
109
|
+
- Fixed `/resume` and `--resume` filling up with "(no messages)" sessions. The picker now hides sessions that have no messages, name, or summary, including ones already saved by earlier versions. Opening such a session by ID still works.
|
|
110
|
+
|
|
5
111
|
## [0.9.38-alpha.9] - 2026-10-17
|
|
6
112
|
|
|
7
113
|
### Fixed
|
|
@@ -4,6 +4,16 @@ All notable changes to the `pi-intercom` extension will be documented in this fi
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.9.38] - 2026-10-18
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Fixed queued workflow instructions being blocked by broker warm-up during model fallback. Stored instructions are admitted before connecting, including sticky messages for replacement sessions ([#3628](https://github.com/bastani-inc/atomic/issues/3628)).
|
|
12
|
+
- Intercom tools now await session records before reporting success or clearing pending replies. Failed commits reach the existing error handling, including local subagent relay diagnostics.
|
|
13
|
+
- Session-list and compose overlays now close when reload or shutdown begins instead of keeping their commands pending.
|
|
14
|
+
- Compose sends already in progress now finish delivery and save exactly one sent-message record even when reload or shutdown dismisses the overlay.
|
|
15
|
+
- Fixed retries of answered Intercom asks reopening pending reply routes and allowing a second distinct reply ([#3666](https://github.com/bastani-inc/atomic/issues/3666)).
|
|
16
|
+
|
|
7
17
|
## [0.9.38-alpha.6] - 2026-10-16
|
|
8
18
|
|
|
9
19
|
### Fixed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/intercom",
|
|
3
|
-
"version": "0.9.38
|
|
3
|
+
"version": "0.9.38",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
|
|
6
6
|
"contributors": [
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.38] - 2026-10-18
|
|
6
|
+
|
|
7
|
+
### Breaking Changes
|
|
8
|
+
|
|
9
|
+
- Forked context now uses the parent's session ID and selected session store, including stored empty IDs. Embedded runners pass a `sessionManager` instead of a `sessionFile` input. Token readers take a store and session ID and return a promise; filesystem paths no longer select a transcript.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Subagent parallel task limits can now be raised above 50 with `parallel.maxTasks`. Configure `parallel.concurrency` and the new `parallel.runningCapacity` together to run more than four child turns per parent; defaults remain 50 tasks, concurrency 3, and running capacity 4.
|
|
14
|
+
|
|
5
15
|
## [0.9.38-alpha.8] - 2026-10-17
|
|
6
16
|
|
|
7
17
|
### Changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/subagents",
|
|
3
|
-
"version": "0.9.38
|
|
3
|
+
"version": "0.9.38",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for delegating tasks to subagents with parallel execution. Fork of: https://github.com/nicobailon/pi-subagents",
|
|
6
6
|
"contributors": [
|
|
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.9.38] - 2026-10-18
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Search and fetched-content results now wait for their session commits before becoming available or notifying the agent. Failed commits reach the existing error handling instead of reporting uncommitted results.
|
|
12
|
+
- An open `/websearch` curator now closes when reload or shutdown begins, without blocking teardown or abandoning an already-started session save.
|
|
13
|
+
|
|
7
14
|
## [0.9.38-alpha.6] - 2026-10-16
|
|
8
15
|
|
|
9
16
|
### Fixed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/web-access",
|
|
3
|
-
"version": "0.9.38
|
|
3
|
+
"version": "0.9.38",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
|
|
6
6
|
"contributors": [
|
|
@@ -6,6 +6,66 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.9.38] - 2026-10-18
|
|
10
|
+
|
|
11
|
+
### Breaking Changes
|
|
12
|
+
|
|
13
|
+
- Workflow discovery now reads only `.atomic` default roots. Discovered workflow modules use `@bastani/atomic/workflows` and `typebox` imports. Removed deprecated imperative API stubs, separate `thinkingLevel` and `fallbackThinkingLevels` authoring fields, old stage-target syntax, and replay without current topology, replay keys, or child exit tags. Put reasoning effort in each model string, such as `provider/model:high`.
|
|
14
|
+
- Execution results always include `toolNodes`, inspection details and status summaries always include `tools`, and custom UI adapters must implement every UI method. Queued stage delivery requires persisted admission order.
|
|
15
|
+
- Heartbeat records require their original launch cadence; incomplete records no longer inherit the current workflow definition. Configuration load results always include `globalConfig` and `projectConfig`, using `null` when a source is absent or invalid.
|
|
16
|
+
- Public run snapshots require `toolNodes`. Inline forms require injected keybindings and no longer include unused submit-choice state. Removed the ignored `preserveAnsi` truncation argument; text truncation remains ANSI-aware.
|
|
17
|
+
- Workflow runs now persist only in the local SQLite journal. Journal initialization failures throw `StorageUnavailableError` instead of continuing without durable storage. Postgres connection settings (`workflows.durability.systemDatabaseUrl` and `workflows.durability.poolSize`) and `DBOS_SYSTEM_DATABASE_URL`, `ATOMIC_POSTGRES_*`, and `PG*` environment variables no longer configure workflow storage.
|
|
18
|
+
- Removed the SDK `durability` option, `WorkflowDurability`, and `WorkflowDurabilityRequiredError`. Use `RunOpts.journal` to select storage or isolate runs, and handle typed journal errors when storage is unavailable.
|
|
19
|
+
- Removed `InMemoryDurableBackend` and `createInMemoryTestBackend`. Use `JournalDurableBackend` over `MemoryRunJournal` for an explicitly in-memory backend. Removed the `legacyRecovery` workflow-tool argument and remaining `workflows.durability` settings.
|
|
20
|
+
- Removed the `@bastani/workflows` import alias; use `@bastani/atomic/workflows`.
|
|
21
|
+
- Custom `RunJournal` implementations must provide `getRun`, `takeoverExpired`, `leaseState`, lazy paged `read`, and `deleteOwnedRun(lease)` for atomic lease-fenced deletion. Synchronous fast paths are internal.
|
|
22
|
+
- Invocation records require `invocationFingerprint`.
|
|
23
|
+
- SDK workflow stages now use persistent session storage by default, including stages without `sessionDir`. Ephemeral stages must explicitly supply an in-memory session manager through an adapter. Storage failures do not fall back to memory.
|
|
24
|
+
- Replaced `SqliteRunJournal` with async `SqlRunJournal.open(database, { prefix })` and `openSqlRunJournal(pathOrDatabase?)`; await `resolveRunJournal`. Journal tables now use the `wf_` namespace with no migration of earlier unreleased tables. Journal storage errors use the shared `StorageUnavailableError` fields `adapter`, `location`, and `cause` instead of `path`.
|
|
25
|
+
- Custom journals must return `LeaseState.ageMs`, a non-negative safe-integer renewal age measured by the journal clock in the same read as the lease state. Ownership probes use this age rather than the process clock.
|
|
26
|
+
- Construct `JournalDurableBackend` with asynchronous `open()`; direct construction and internal synchronous journal methods have been removed.
|
|
27
|
+
- `RunOpts.journal.database` requires the async SQLite facade; wrap an existing native connection with `wrapNodeSqliteDatabase`. Journal selection errors now use `StorageConfigError` and its `source`, `field`, and `reason` fields instead of `JournalConfigurationError`.
|
|
28
|
+
- Replaced `forkFromSessionFile` with `forkFromSessionId`. Use the prior task's `sessionId` in the selected session store. `recordStageSession` now accepts `{ sessionId }` only. Retained chat validation and completed inspection are asynchronous, and transcript paths are display metadata, not resume or fork identities.
|
|
29
|
+
- Durable backend registration, status, reset, and checkpoint writes now use awaited `commit*` methods. Replace `registerWorkflow` with `commitWorkflowRegistration`, `setWorkflowStatus` with `commitWorkflowStatus`, `transitionWorkflowStatus` with `commitWorkflowStatusTransition`, `adjustPendingPrompts` with `commitPendingPromptAdjustment`, and `reset` with `commitReset`. Use `commitCheckpoint` instead of either checkpoint writer and `commitAdditiveCheckpointBestEffort` for additive writes. Cached `ctx.stage()` declarations remain synchronous; their replay metadata is committed before the next async execution boundary.
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- Added `MemoryRunJournal`, public SQLite journal and error exports, and `registerRunJournalConformance` for shared journal contract checks.
|
|
34
|
+
- Added `RunOpts.journal` and `resolveRunJournal` for explicit journals, caller-owned SQLite connections, memory journals, and configurable files. TUI, CLI, background, and SDK runs use the selected journal. Resolution prioritizes the explicit option, a non-empty `ATOMIC_WORKFLOW_JOURNAL_PATH`, then journal settings and the default path. Relative settings paths resolve against the Atomic home directory.
|
|
35
|
+
- Extended shared journal conformance checks to cover detached values, closed-journal rejection, failure atomicity, and deletion tombstones.
|
|
36
|
+
- Added stale-only async journal takeover and read-only ownership inspection. Keyed append retries return the original entry before checking sequence expectations. Shared journal conformance covers stale-only takeover and early read termination.
|
|
37
|
+
- Added facade-backed SQL journals for user-supplied SQLite-compatible drivers, optional table prefixes, shared session/journal databases, database-clock lease expiry, and sequence-checked `deleteOwnedRun(lease, expectSeq?)`.
|
|
38
|
+
- Added journal adapter module selection with environment/file secret references and shared `storage` settings. SDK options override environment, journal settings, shared storage, and persistent defaults; nearer settings replace complete selections. Caller-owned database selections accept the async SQLite facade and remain open after journal close.
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- Fixed second and later durable SDK `run()` calls in the same process failing with `atomicWorkflowHandle is not a registered DBOS workflow function`. Each standalone run now recreates its durable backend after the previous run shuts it down ([#3614](https://github.com/bastani-inc/atomic/issues/3614)).
|
|
43
|
+
- Fixed workflow fallback leaking the original stage session when an intervening candidate fails to initialize. The original session is now disposed exactly once after it becomes idle when a successor is adopted, or during final cleanup if no successor is created ([#3655](https://github.com/bastani-inc/atomic/issues/3655)).
|
|
44
|
+
- Fixed retained stage history load failures appearing as empty archives. Missing, unreadable, malformed, empty, or deleted session files now show an actionable session-unavailable warning without creating a blank session or discarding displayed messages ([#3658](https://github.com/bastani-inc/atomic/issues/3658)).
|
|
45
|
+
- Fixed standalone SDK `run()` resolving string stage models, including thinking suffixes and fallback models, instead of crashing during session creation ([#3629](https://github.com/bastani-inc/atomic/issues/3629)).
|
|
46
|
+
- Fixed queued Intercom instructions preventing stage model fallback. Delivery failures now block resumably and preserve sticky instructions for resumed runs and later stages ([#3628](https://github.com/bastani-inc/atomic/issues/3628)).
|
|
47
|
+
- Fixed workflow recovery reporting a foreign run as available at the exact lease-expiry boundary before takeover is permitted ([#3681](https://github.com/bastani-inc/atomic/pull/3681)).
|
|
48
|
+
- SQL journals snapshot append payloads at invocation, including keyed retries, preserving status/event consistency during queued writes. User-supplied facades may return readonly rows. Header and append serialization failures now retain typed storage errors and their original causes without changing fencing, replay, or sequence-check precedence.
|
|
49
|
+
- Journal run summaries and status validation now use the serialized `StatusChanged` payload, including transformations by `toJSON`, so recorded events and summaries agree. Ownership inspection now honors the journal clock even when the process clock is skewed.
|
|
50
|
+
- Fixed workflow error cards hiding text-only failures as `no result`. Errors without structured details now show their text and an error indication in collapsed and expanded cards ([#3669](https://github.com/bastani-inc/atomic/issues/3669)).
|
|
51
|
+
- Fixed failed workflow resumes reporting partial progress solely because a sibling was already running. Requests with no acknowledged effect now report no change and retain their failure code ([#3670](https://github.com/bastani-inc/atomic/issues/3670)).
|
|
52
|
+
- Fixed workflow pause reporting `noop` after a stage pause took effect but durable capture failed, including whole-run and bulk requests. The result now reports `partial`, explains that the pause remains in effect, and preserves the failure code and message ([#3671](https://github.com/bastani-inc/atomic/issues/3671)).
|
|
53
|
+
- Workflow journal shutdown waits for queued writes before releasing ownership. Status claims and checkpoints on the same run remain ordered with asynchronous journals.
|
|
54
|
+
- Completed standalone SDK runs now release their stage sessions when no caller registry owns them. Workflow forks and completed-history inspection release temporary session-store connections while preserving caller-owned stores.
|
|
55
|
+
- Starting a workflow after a workflow's completed, failed, or blocked notice no longer fails with `Workflow execution for <runId> is retired`. Notices and late stage messages now reach the chat outside the finished run's execution context.
|
|
56
|
+
- Fixed `/workflow resume` no longer listing or resuming runs recorded before 0.9.38-alpha.6. The default journal now lists runs from its earlier tables and converts a run only when you resume or inspect it, so opening the journal does no extra work. The earlier tables are left in place, and deleted runs stay deleted. Stage checkpoints that identified their session only by transcript path now resume by that transcript's session ID, so their conversations reopen after sessions are imported into the default store.
|
|
57
|
+
- Fixed the `Workflow discovery diagnostics` warning appearing twice at startup when deferred startup, such as project trust, refreshes workflow discovery. An unchanged report is shown once; a refresh that changes it still shows the new one ([#3703](https://github.com/bastani-inc/atomic/issues/3703)).
|
|
58
|
+
|
|
59
|
+
### Removed
|
|
60
|
+
|
|
61
|
+
- Removed DBOS, embedded Postgres, their bundled runtimes and native process ownership, and the non-durable storage fallback. Server-specific admission, recovery, outage handling, and deferred persistence queues are gone; workflow pause, resume, quit, answer, and checkpoint replay remain supported.
|
|
62
|
+
|
|
63
|
+
## [0.9.38-alpha.11] - 2026-10-17
|
|
64
|
+
|
|
65
|
+
### Fixed
|
|
66
|
+
|
|
67
|
+
- Fixed the `Workflow discovery diagnostics` warning appearing twice at startup when deferred startup, such as project trust, refreshes workflow discovery. An unchanged report is shown once; a refresh that changes it still shows the new one ([#3703](https://github.com/bastani-inc/atomic/issues/3703)).
|
|
68
|
+
|
|
9
69
|
## [0.9.38-alpha.8] - 2026-10-17
|
|
10
70
|
|
|
11
71
|
### Fixed
|
|
@@ -75617,10 +75617,14 @@ function registerWorkflowLifecycleHandlers(pi, deps) {
|
|
|
75617
75617
|
return confirmSessionSwitch(reason, ctx);
|
|
75618
75618
|
});
|
|
75619
75619
|
pi.on("session_before_fork", async (_event, ctx) => confirmSessionSwitch("fork", ctx));
|
|
75620
|
+
let notifiedDiscoveryDiagnostics = null;
|
|
75620
75621
|
const notifyDiscoveryDiagnostics = (ctx) => {
|
|
75621
75622
|
if (!ctx?.ui)
|
|
75622
75623
|
return;
|
|
75623
75624
|
const diagnostics = formatStartupDiagnostics(null, runtimeState.discoveryRef.current);
|
|
75625
|
+
if (diagnostics === notifiedDiscoveryDiagnostics)
|
|
75626
|
+
return;
|
|
75627
|
+
notifiedDiscoveryDiagnostics = diagnostics;
|
|
75624
75628
|
if (diagnostics !== null)
|
|
75625
75629
|
ctx.ui.notify?.(diagnostics, "warning");
|
|
75626
75630
|
};
|
|
@@ -75737,6 +75741,7 @@ function registerWorkflowLifecycleHandlers(pi, deps) {
|
|
|
75737
75741
|
if (reason === "startup")
|
|
75738
75742
|
lifetime.startupStarted = true;
|
|
75739
75743
|
startupResourcesDiscovered = false;
|
|
75744
|
+
notifiedDiscoveryDiagnostics = null;
|
|
75740
75745
|
runtimeState.resetWorkflowDiscoveryForSession();
|
|
75741
75746
|
await runtimeState.ensureWorkflowConfigLoaded();
|
|
75742
75747
|
if (stopsWorkflows) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-session-prompt.d.ts","sourceRoot":"","sources":["../../src/core/agent-session-prompt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAIlE,OAAO,KAAK,EAAE,2BAA2B,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAOzG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-session-prompt.d.ts","sourceRoot":"","sources":["../../src/core/agent-session-prompt.ts"],"names":[],"mappings":"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"}
|
|
@@ -5,6 +5,7 @@ import { resolveWorkflowStageDeliveryTarget } from "./agent-session-delivery-for
|
|
|
5
5
|
import { formatNoApiKeyFoundMessage, formatNoModelSelectedMessage, formatUnresolvedModelMessage, } from "./auth-guidance.js";
|
|
6
6
|
import { runCallback } from "./callback-activity.js";
|
|
7
7
|
import { expandPromptTemplate } from "./prompt-templates.js";
|
|
8
|
+
import { reserveQueuedInputAdmission, runInputHook, UNORDERED_ADMISSION, } from "./queued-input-admission.js";
|
|
8
9
|
import { assertSessionOpen, sessionGenerationClosing, sessionLifetime, sessionQuitSignal, trackSessionWork, } from "./session-lifecycle-work.js";
|
|
9
10
|
import { getSkillCatalog } from "./skill-catalog.js";
|
|
10
11
|
const customPreparations = new WeakMap();
|
|
@@ -85,6 +86,22 @@ async function admittedPrompt(text, options) {
|
|
|
85
86
|
this._activePromptCount -= 1;
|
|
86
87
|
}
|
|
87
88
|
}
|
|
89
|
+
function isExtensionCommand(session, text) {
|
|
90
|
+
if (!text.startsWith("/"))
|
|
91
|
+
return false;
|
|
92
|
+
const spaceIndex = text.indexOf(" ");
|
|
93
|
+
const commandName = spaceIndex === -1 ? text.slice(1) : text.slice(1, spaceIndex);
|
|
94
|
+
return session._extensionRunner?.getCommand(commandName) !== undefined;
|
|
95
|
+
}
|
|
96
|
+
/** Extension commands and extension-delivered messages run immediately rather than in submission order. */
|
|
97
|
+
function reserveAdmissionForQueuedPrompt(session, text, options) {
|
|
98
|
+
const lane = options?.streamingBehavior;
|
|
99
|
+
if (lane === undefined || options?.source === "extension")
|
|
100
|
+
return UNORDERED_ADMISSION;
|
|
101
|
+
if ((options?.expandPromptTemplates ?? true) && isExtensionCommand(session, text))
|
|
102
|
+
return UNORDERED_ADMISSION;
|
|
103
|
+
return reserveQueuedInputAdmission(session, lane, sessionLifetime(session));
|
|
104
|
+
}
|
|
88
105
|
async function promptInternal(text, options) {
|
|
89
106
|
const lifetime = sessionLifetime(this);
|
|
90
107
|
const assertCurrent = () => {
|
|
@@ -99,6 +116,7 @@ async function promptInternal(text, options) {
|
|
|
99
116
|
const workflowDelivery = options?.__workflowDelivery;
|
|
100
117
|
let messages;
|
|
101
118
|
let preparingRun = false;
|
|
119
|
+
const admission = reserveAdmissionForQueuedPrompt(this, text, options);
|
|
102
120
|
try {
|
|
103
121
|
// Authorize workflow delivery before commands or input extensions can perform side effects.
|
|
104
122
|
// A later terminal transition cannot retroactively reject input accepted at this boundary.
|
|
@@ -121,6 +139,10 @@ async function promptInternal(text, options) {
|
|
|
121
139
|
// compaction, or a provider turn; explicit resume makes it eligible again.
|
|
122
140
|
if (this._queuedMessagesPaused) {
|
|
123
141
|
const delivery = options?.streamingBehavior === "followUp" ? "followUp" : "steer";
|
|
142
|
+
const earlierAdmissions = admission.waitForTurn();
|
|
143
|
+
if (earlierAdmissions)
|
|
144
|
+
await earlierAdmissions;
|
|
145
|
+
assertCurrent();
|
|
124
146
|
if (delivery === "followUp")
|
|
125
147
|
await this._queueFollowUp(text, options?.images);
|
|
126
148
|
else
|
|
@@ -133,7 +155,7 @@ async function promptInternal(text, options) {
|
|
|
133
155
|
let currentText = text;
|
|
134
156
|
let currentImages = options?.images;
|
|
135
157
|
if (this._extensionRunner.hasHandlers("input")) {
|
|
136
|
-
const inputResult = await this._extensionRunner.emitInput(currentText, currentImages, options?.source ?? "interactive", this.isStreaming ? options?.streamingBehavior : undefined);
|
|
158
|
+
const inputResult = await runInputHook(() => this._extensionRunner.emitInput(currentText, currentImages, options?.source ?? "interactive", this.isStreaming ? options?.streamingBehavior : undefined));
|
|
137
159
|
assertCurrent();
|
|
138
160
|
if (inputResult.action === "handled") {
|
|
139
161
|
workflowDelivery?.delivered?.("handled");
|
|
@@ -151,6 +173,10 @@ async function promptInternal(text, options) {
|
|
|
151
173
|
expandedText = this._expandSkillCommand(expandedText);
|
|
152
174
|
expandedText = expandPromptTemplate(expandedText, [...this.promptTemplates]);
|
|
153
175
|
}
|
|
176
|
+
const earlierAdmissions = admission.waitForTurn();
|
|
177
|
+
if (earlierAdmissions)
|
|
178
|
+
await earlierAdmissions;
|
|
179
|
+
assertCurrent();
|
|
154
180
|
// If streaming, queue via steer() or followUp() based on option. The run is still
|
|
155
181
|
// open while agent_before_settle handlers decide on its continuation, so input sent
|
|
156
182
|
// from that boundary queues for the continuation instead of starting a second run.
|
|
@@ -168,6 +194,7 @@ async function promptInternal(text, options) {
|
|
|
168
194
|
preflightResult?.(true, "queued");
|
|
169
195
|
return;
|
|
170
196
|
}
|
|
197
|
+
admission.release();
|
|
171
198
|
// Close the completed fallback lifecycle before validating credentials for
|
|
172
199
|
// the next idle prompt. The selected fallback remains the session model.
|
|
173
200
|
if (typeof this._settleFallbackModelScope === "function")
|
|
@@ -264,6 +291,9 @@ async function promptInternal(text, options) {
|
|
|
264
291
|
preflightResult?.(false);
|
|
265
292
|
throw error;
|
|
266
293
|
}
|
|
294
|
+
finally {
|
|
295
|
+
admission.release();
|
|
296
|
+
}
|
|
267
297
|
assertCurrent();
|
|
268
298
|
let dispatched = false;
|
|
269
299
|
const reportDispatch = (disposition) => {
|
|
@@ -691,24 +721,36 @@ async function admittedQueueUserInput(session, text, images, behavior, source) {
|
|
|
691
721
|
const lifetime = sessionLifetime(session);
|
|
692
722
|
if (text.startsWith("/"))
|
|
693
723
|
session._throwIfExtensionCommand(text);
|
|
694
|
-
|
|
695
|
-
|
|
724
|
+
const admission = source === "extension" ? UNORDERED_ADMISSION : reserveQueuedInputAdmission(session, behavior, lifetime);
|
|
725
|
+
try {
|
|
726
|
+
if (session._extensionRunner?.hasHandlers("input")) {
|
|
727
|
+
const result = await runInputHook(() => session._extensionRunner.emitInput(text, images, source, session.isStreaming ? behavior : undefined));
|
|
728
|
+
assertSessionOpen(session);
|
|
729
|
+
if (lifetime.aborted)
|
|
730
|
+
throw Object.assign(new Error("Session is closed"), { code: "SessionClosed" });
|
|
731
|
+
if (result.action === "handled")
|
|
732
|
+
return "handled";
|
|
733
|
+
if (result.action === "transform") {
|
|
734
|
+
text = result.text;
|
|
735
|
+
images = result.images ?? images;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
const expandedText = expandPromptTemplate(session._expandSkillCommand(text), [...session.promptTemplates]);
|
|
739
|
+
const earlierAdmissions = admission.waitForTurn();
|
|
740
|
+
if (earlierAdmissions)
|
|
741
|
+
await earlierAdmissions;
|
|
696
742
|
assertSessionOpen(session);
|
|
697
743
|
if (lifetime.aborted)
|
|
698
744
|
throw Object.assign(new Error("Session is closed"), { code: "SessionClosed" });
|
|
699
|
-
if (
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
745
|
+
if (behavior === "steer")
|
|
746
|
+
await session._queueSteer(expandedText, images);
|
|
747
|
+
else
|
|
748
|
+
await session._queueFollowUp(expandedText, images);
|
|
749
|
+
return "queued";
|
|
750
|
+
}
|
|
751
|
+
finally {
|
|
752
|
+
admission.release();
|
|
705
753
|
}
|
|
706
|
-
const expandedText = expandPromptTemplate(session._expandSkillCommand(text), [...session.promptTemplates]);
|
|
707
|
-
if (behavior === "steer")
|
|
708
|
-
await session._queueSteer(expandedText, images);
|
|
709
|
-
else
|
|
710
|
-
await session._queueFollowUp(expandedText, images);
|
|
711
|
-
return "queued";
|
|
712
754
|
}
|
|
713
755
|
/**
|
|
714
756
|
* Queue a steering message while the agent is running.
|