Repository navigation
fix(session): defer Bash publication and support text-only prompt hooks - #390
Merged
Merged
Conversation
Haoming9527
changed the base branch from
fix/333-complete-incremental
to
main
October 24, 2026 16:14
This was referenced Oct 24, 2026
Haoming9527
marked this pull request as ready for review
October 24, 2026 17:03
This was referenced Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #386
Closes #387
Closes #375
What was wrong
Session creation and sandbox-mode events could register or dispose
ops_bashwhile the host was still publishing a session append. The host rejected the nested append and left the new scope without Bash. Separately, DSH 0.2.1-rc.3 supplies text-onlyPromptPresentationvalues to the assembly waterfall; readingresult.tools.lengthcrashed an active PTC scope before its first step.The change
Coalesce Bash lifecycle notifications into the next event-loop turn, keep unchanged registrations, check live authority in retained callbacks, and cancel queued publication on unload. Await publication during agent creation and rebuild a first prompt that took its schemas before a pending publication. Disposal requested by an append observer also defers registry writes. Distinguish the text-only waterfall from complete PTC assembly probes: the latter still require exactly one
run_codeschema and the PTC instruction.Add a cold-start regression for the readiness-order fix already merged in #366: hold discovery startup pending while the first prompt assembles, then require that first prompt to succeed after the selected replacement publishes. This closes #375 by preserving its existing implementation fix.
This follows #383, whose commits are included here. The base is main so the existing pull-request workflow branch filter runs; merging #383 first will narrow this PR's diff automatically. No new dependencies, version changes, tool schemas or argument contracts.
Validation
node test/run.mjs session-lifecyclefailed 2/2 assertions: nested-append registration rejection and the exactCannot read properties of undefined (reading 'length')error.edf70d8passes 3/3 lifecycle assertions, including actual append reentry protection, deferred disposal, retained-callback authority and first-prompt readiness. The host guard is a synchronous per-session boolean reset infinally, not async-local state.READINESS_BLOCKED: missing OPS surface; restoring it passed.edf70d8: run 40112481896; all checks passed, including Linux, macOS, Windows, Node floor, source-size, tools trial, workflow lint and the required aggregate.The rc.3 change covers this prompt hook contract. It does not declare every rc.3 host API compatible: selected hide-official replacement still fails closed where the new host withholds its authoritative schema snapshot from the waterfall. No Desktop GUI timing or #359 indefinite-stall resolution is claimed.
Environment
Windows x64, Node v26.12.1 for the initial full run and v24.19.0 for final focused rechecks, Rust cargo 1.99.0; source checkout based on #383 refreshed head fe06fa4, which includes main 662a388. Native source is this exact branch, built in its private native/target; Bash fixture is the pinned @dsh-ops/[email protected] payload.