* fix(subagent): restore shared concurrency guidance from #8698
Restore the change removed when master was rolled back.
Cherry-picked from 014aa1659bcd0ba3cf5d2b4c096773f01f56ec50.
* refactor(ui-tool): clarify subagent member parsing
* feat(sdk): report why a session agent was disposed
A request for a session whose agent left the registry now states whether the
whole runtime is shutting down, the SDK server is shutting down, or only the
agent loop was unloaded. During runtime shutdown it names the last process
event observed before teardown; for an agent-loop unload it gives the time and
the plugin whose unload began first. The liveness check reads the registry as
optional, so both stages of root disposal report the same failure.
Refs #8737
* fix(sdk): keep the runtime observation out of the plugin entry exports
The static gates reject a new read of the Cordis root context, a value export
from a function plugin entry, and new assertions to unknown. The plugin entry
now passes the server an observation built from the root fiber it already
holds, the helper lives in the internal process-events module, and the new
tests complete the handshake instead of casting the server.
Refs #8737
* fix(sdk): keep the process-event record from throwing and state the unload origin as an observation
A rejection value without a string form made the failure text throw inside a
prepended listener, which would end the dispatch before the listener that owns
the event. The text now falls back to a fixed marker. The plugin named for an
agent-loop unload is the first one unloading at that time, which overlapping
unloads can make unrelated, so the message and README say that.
Refs #8737
* feat(python-sdk): log the runtime's stderr lines as they arrive
The runtime writes its fatal report, including the stack of an unhandled
rejection that ends the process, to its own stderr. The SDK kept those lines
in memory and attached them only to initialization, timeout, and transport
failures, so a host saw none of it for an ordinary JSON-RPC error. Each line
now also goes to the Python logger deepseek_harness.runtime at INFO.
Refs #8737
One fetch of the registry called the provider once with every due change
request of a forge, under one fetchTimeoutMs deadline. forge-github read
that call in several queries, so a read of many pull requests could
outlive the deadline as a whole, and a query whose gh run hung ended the
read before its own timeout isolated it. Either way the results of the
queries already answered were discarded.
A provider may now name snapshotBatchSize and briefBatchSize. The
registry then calls it once per that many due change requests of a host,
one call after another, each within its own fetchTimeoutMs, and settles
the watches of a call when it returns. A call that fails or outlives its
deadline fails only its own change requests. A change request that lost
its watchers while it waited is not read, and one whose watchers changed
what its polls read is read by the fetch of that level.
forge-github names its two query sizes, so one polling call holds one
query. briefBatchSize now defaults to 25: a query of 50 took up to 6.8
seconds against GitHub's 10-second limit, and one of 25 up to 3.4.
The subsystem page and the Cordis catalog also take in the signatures
the three commits before this one added.
Every saved viewed mark announced a review change, which dropped the
review threads kept for the change request and made each open changes
view read all viewed marks and all threads from the code host again.
The Host now keeps the viewed marks it read for a change request by head
commit, under the bounds the kept threads have. A mark saved through
ctx.forge at that head replaces the kept state of its file, and the kept
threads stay, since a viewed mark changes no thread. The read that
follows a save is answered from memory, so a save costs the provider's
write and no further read. The reader's refresh passes fresh and reads
the code host again, as it does for threads.
ReviewCache is generic over what it keeps and gains amend() for a write
whose effect on the kept read is known.
Change requests were read together only when they became due in the same
millisecond, so 14 list watches that drifted apart cost up to 415 brief
queries an hour in place of 30. A poll now also reads the change
requests past the midpoint of their wait, which brings them back into
one fetch. The default intervals become 15 seconds while checks run and
60 seconds otherwise. An unknown mergeability earns one poll at the
active interval; a change request that keeps reporting it waits the idle
interval. refresh() accepts maxAgeMs and then leaves a change request
alone whose poll is in flight or recent.
The panel, Session list, and review count streams close once the page
has been hidden for 30 seconds and reopen when it shows, so the Host
polls no code host for a page nobody sees.
A Session's panel keeps its last state, snapshots, and branch lookup
when its last follower leaves, and the next panel starts from them: it
publishes that state first and repeats neither the sign-in probe of a
ready host nor the branch lookup. Showing the panel and focusing the
window call the new revisit Remote, which reinspects the checkout and
polls only change requests whose latest poll is older than
statusMaxAgeMs; refresh stays the forced read a reader asks for. A
status read refused as unauthenticated on a host shown as ready probes
sign-in again, once per run of refusals. The changes view waits for the
first status of a panel stream before it reads a change request whose
entry shows a kept snapshot.
The panel follow resolved its Session argument by resuming the Agent while the
main view was still opening the same Session, so the Host read the Session log
twice. The follow stream now holds a forgePanel Session reference and waits for
the Session's history to open before following. refresh, reviewStage, and
worktreeCleanup only need the identity, so they take a SessionId and no longer
resume an Agent; worktrees.cleanupOf takes the id as well.
Open caller-supplied content through the shared document renderer without depending on inline diagram visualization. Keep checkpoint reads tied to their optional preview-service activation and cover cancellation in both the service and the chat row.
Brings the snapshot query limit of #8323 together with the status briefs
so one pull request carries both.
The limit is named snapshotBatchSize beside briefBatchSize. A snapshot
read and a brief read now share GitHubProvider.statusQueries: each
builds every query before the first request, across hosts, sends them in
turn, and fails only the pull requests of a query whose gh run fails or
that GitHub refuses. fetchHost and fetchDocument become fetchSnapshots,
which reads one query through statusOutput.
Tests cover snapshotBatchSize 3 and 1, a reference on a later host that
cannot be inlined, and both levels through the plugin's configuration
and a gh script. The README states the deadline that a read's queries
share instead of measured numbers, which move to the Agent Note.
The Session list read the full snapshot of every change request a listed
Session binds: up to 100 check contexts, reviewers, review threads, and
linked issues each, all in one GraphQL document per host. GitHub ends a
request after 10 seconds of processing, so about 30 bound pull requests
made every list read fail. Opening a Session whose change request the
list already watched read nothing until the next regular poll.
The forge registry now watches a change request at two levels. A brief
holds the title, state, draft flag, mergeability, review decision, and
combined check outcome. A watched change request is polled for its
snapshot while it has a snapshot watcher and for its brief otherwise,
with one fetch in flight per forge and level. Providers read briefs
through the optional fetchBriefs; forge-github reads them from scalars
and statusCheckRollup.state, briefBatchSize (50) pull requests per
query.
The Session list watches briefs and names the state it already holds,
so a merged change request is not read again and a list that reopens in
the same process waits for the interval. The Session panel and the
review page ask for a status no older than statusMaxAgeMs (10 seconds)
when they start to show a change request.
Processes of one profile can run different versions of a plugin at the same time, and they share
the profile's pin directory. A registration that deleted the other pins after every download made
two such processes delete each other's pin and download their own again at every check. Each
registration now deletes the other pins once, the first time its own pin is in place; a process
whose pin another process deleted downloads it again and leaves that process's pin in place.
The README and the Agent Note no longer state that no other installation reads the directory, and
the README lists the remaining case as a known limitation.