Repository navigation
feat(appserver): read a line's adopted configuration - #1970
Conversation
A line's adopted model had no bounded, branch-qualified read: attach answers
the root, a transcript window omits `context/configured`, and
`session.history` cannot mix an ancestor's adoption with the line's own
sequence.
`session.model.get {sessionId, branchId, through?}` answers the line's
configuration at its own committed cutoff. An open line reads from Prompt,
advancing the Dispatcher to the committed head so an adoption committed just
before the call is included; an ended line, or an explicit cutoff, reads the
same `Chain + context/configured + Last` query from the tree and is not
reopened. The returned `through` is always the requested line's own cutoff,
never an ancestor's sequence.
The method is listed in `hello.features` with `session_execution` admission,
not in `LOCAL_EXECUTION_METHODS`. Contract tests cover a root and a child
line, an ended line, an unknown line and a configuration committed
immediately before the read; the branch design document is updated in both
languages.
eric8810
left a comment
There was a problem hiding this comment.
The branch-qualified read is the right boundary for #1963. It avoids deriving current configuration from the transcript, and the historical path returns the selected line’s cutoff rather than an ancestor’s sequence.
[P2] The live result can pair a newer configuration with an older through. Prompt::adopted_configuration (crates/dim-agent-capabilities/src/prompt.rs:1071–1081) captures T from timeline.committed(), awaits advance(T), then clones the current projection. prompt/recovery.rs:1383–1410 only waits for the dispatcher to reach at least T; meanwhile the independent event handler can apply a later context/configured under the projection lock (prompt.rs:903–927). The result can therefore contain model B from U > T but say through: T. An explicit read at T still returns A. This violates the snapshot contract and lets a client replay events that the returned snapshot already contains, potentially rolling its model back if more than one adoption is queued.
Please read the owner’s configuration at an exact captured cutoff, or capture the corresponding projection watermark and configuration coherently under the same synchronization. If using an exact query after waiting, preserve the existing publication/closing semantics. The current pre-committed-adoption test covers the old-config/new-cutoff direction; add a controlled interleaving that pauses the read, publishes another adoption, and checks that the head reply agrees with a pinned read at its returned through. Static paths checked; I did not run the Rust suite.
zerob13
left a comment
There was a problem hiding this comment.
[P2] Read the adopted configuration while a child is closing. crates/dim-app-server/src/connection/tree.rs:599–621 falls back to TimelineTree only after the child is marked ended. A child can already have lost the Prompt service before the parent’s branch/ended fact is published (crates/dim-agent-capabilities/src/timeline_tree.rs:2182–2233). In a controlled local transport test, I held that publication after the child scope closed. The unpinned session.model.get returned service_reloading twice, while a pinned read for the same child and committed cutoff returned its adopted model. Use the TimelineTree owner read for this closing transition and keep genuine reload errors for an active branch.
Documentation follow-up: In docs/design/clients.md:167–184, limit the session.attach fallback to root configuration. The projection in connection/subscription.rs:564–600 can name a non-root default while its model fields still describe root; a client cannot infer that child's model from the fallback.
The three existing transport tests passed on this head. I also reproduced the already-reported configuration/through mismatch; see review #6003097268 for that separate finding.
A live `session.model.get` could pair a newer configuration with an older `through`: the owner read captured the committed head, waited for the Dispatcher, then cloned the projection, so an adoption applied in between came back at the previous cutoff. The read now takes the configuration and the projection's applied cutoff under one lock and reports that cutoff, never below the head it waited for, so a pinned read at the returned value always answers the returned configuration. A line can also lose its scope before its parent records `branch/ended`: an unpinned read then answered `service_reloading` while a pinned read of the same cutoff answered its adopted model. The owner read now answers from the tree when the line's own `branch/end` is committed, through a new Rust-only `TreeCommands::end_committed`, and an active line that is reloading keeps its reload error instead. Three controlled interleavings pin the behaviour without sleeps: a read held after it captures the head while a later adoption is applied, the Dispatcher held before a committed adoption while the read reports that it must wait, and a closing line held between the close of its scope and the parent's record of its end. A Session row reload shows an active line answering the reload error. The branch design document states the reported cutoff, the closing transition and the attach fallback, in both languages; the clients document limits that fallback to the root's configuration.
|
Thanks - the pairing was wrong, and the fix takes your second option: the owner answers the configuration and the cutoff together, under one lock.
The cutoff is still the requested line's own sequence. A line's projection is restored at its own committed cutoff and applies only that line's facts, so the value never comes from an ancestor, and it is never below the head the read waited for. I kept the owner's pair rather than adding an exact chain query after the wait: the reply then describes the state the line is actually running with, it needs no second store read on the open path, and nothing new can drift from the owner's own recovery query. The tree read stays for the ended line and an explicit Two controlled interleavings pin both directions, with no sleeps:
The holds are two hooks behind the capabilities crate's |
|
Thanks - both points are in. For the closing transition, an unpinned read now asks the tree whether the line's own Two tests cover both sides, each held at a known point with no sleeps:
The check is a new Rust-only read on the tree's service, For the documentation, the clients design document now says the attach reply's model fields describe the root even when its |
… hui/session-model-get-2
zerob13
left a comment
There was a problem hiding this comment.
The previous closed-scope fallback and configuration/cutoff findings are fixed. One earlier close phase remains: connection/tree.rs:599–626 only falls back for terminal errors when Prompt is still mounted. In two isolated lifecycle checks, reading during normal close while its interrupt publication was pending returned session_invalid_input / future timeline sequence; a read at the published cutoff still returned the adopted model. Use a valid published cutoff (or wait for it) when the branch is closing but Prompt remains mounted. All six existing model-get cases passed locally; exact hosted Linux was pending at the independent review.
eric8810
left a comment
There was a problem hiding this comment.
Reviewed at head b5d632d.
The read is placed correctly and for the stated reason. session.model.get answers from the owner — Prompt::adopted_configuration() on the line itself when it is open — and falls back to the tree's chain read at the line's fixed head when the line has ended, is closing, or an explicit through was asked for. The comment on the method says the App Server owns none of the answer, and the code matches it: the transport resolves a session and a line, then delegates. That is ADR 021's shape rather than a transcript scan or a window.
configuration_query is the part worth keeping: Chain scope, through cutoff, pick: Last, selecting only data, documented as shared with Prompt's recovery read so the two cannot disagree about what a line adopted. One query shape used by both readers is exactly the "one type per kind of data" rule applied to a read, and it makes "what did this line adopt" unanswerable two ways.
Mapping BranchEnded/Cancelled/Closed to the fixed-head read rather than an error is a decision with a business meaning — a closed line's adoption is still a fact — not a swallowed failure, and the alternative would have made an ended line's model unreadable.
verify (linux) and ci-ok failed on this head, in the CLI update machinery, which no file of this PR reaches:
crates/dimcode/tests/cli_flow/staged_update.rs:88
staged_update::an_update_that_installs_nothing_keeps_the_installed_command
install updater at "…/node_modules/dimcode-alpha/bin/dimcode": exit status: 1
214 passed; 15 failed
update_entry::update_reports_a_source_build_and_sends_no_input
161 passed; 1 failed
Fifteen staged_update cases plus one update-entry case, all failing at the point where the fixture installs the updater — an environment or fixture failure in the npm-install path, and that area has been red on main repeatedly this week. Nothing here touches it.
Not approving while a required check is red.
Non-blocking: none.
A normal close commits its interrupt before the store publishes it. An unpinned `session.model.get` of that line took the last assigned sequence as its cutoff after the branch phase had become closing; the owner's recovery read at that sequence was refused as a future sequence, so the call answered `session_invalid_input` while a pinned read at the published head still answered the adopted model. The owner read now clamps its cutoff to the line's published head when the branch is not active and reports the cutoff it used. The configuration and the cutoff still come from one projection lock, so a pinned read at the returned value always answers the returned configuration. Active lines keep the wait for the Dispatcher, and an active line under reload keeps its reload error. A new flow test holds the publication of the close interrupt with a store hook (feature `testing`) while the line is closing and its owner is still mounted, then reads without a cutoff, reads again at the returned cutoff, and gets the adopted model both times. The branch design document now names the published head for a closing line and describes the reported cutoff as the last applied source fact's sequence, in both languages.
eric8810
left a comment
There was a problem hiding this comment.
Reviewed at head 313dbfc.
This head carries 46 commits since the one I read, and none of them touch this PR's own change: connection/tree.rs, protocol.rs, transport.rs, the timeline_tree read and the model_get test are all unchanged from b5d632d1. The delta is main merged in — the TypeScript service faces, InputQueue face, os_string and the regenerated catalog. So my finding at b5d632d1 stands as written: the read answers from the owner (Prompt::adopted_configuration() on an open line) and falls back to the tree's chain read at the fixed head, with configuration_query shared with Prompt's recovery read so the two cannot disagree about what a line adopted. That is ADR 021's shape, not a transcript scan.
verify (linux) and ci-ok failed on this head, in one TUI frame test this PR cannot reach:
crates/dimcode/tests/support/cli_harness.rs:893
staged_update::tui_update::update_now_falls_back_to_manual_command_for_an_old_daemon
Terminal did not show "To update, exit DimCode and run: dima update"
228 passed; 1 failed
Worth noting what changed for the better: the previous head failed fifteen staged_update cases at the point where the fixture installs the updater; this head fails one, and it fails at a terminal frame assertion rather than at an install step. That is the update_now/TUI-frame cluster that has been red across many heads, not an install-path break, and the "Did not show" message is the frame not having settled inside the harness's wait.
Not approving while a required check is red.
Non-blocking: none.
|
Fixed: a closing line now answers The failure came from the owner read, not from the protocol. While the line's scope is closing, The owner read now takes the line's published head as its cutoff when the branch is not active, and reports that cutoff. The configuration and the cutoff are still read together under the projection lock, so the reply's New coverage: The design text now says that a closing line answers at its published head, and the parenthetical about the reported cutoff names the sequence of the last applied source fact. |
eric8810
left a comment
There was a problem hiding this comment.
Re-reviewed at 8d918e48. Clamping to the published head fixes the pending-interrupt sequence error, and the new test checks that the returned through can be read back while that interrupt is still held.
[P2] Do not make a closing configuration read wait for a Prompt recovery write. The closing path in prompt/recovery.rs:1388–1392 clamps the lookup, but recover_sources still unconditionally waits for projection.written_result at :1505–1508. That sequence is not bounded by the published cutoff. The replay can also create it itself: a published prompt/changed source can reach step during the read and append a prompt-state/recovered checkpoint (:1491–1497, :748–787, :893). If the writer is still holding an older close interrupt, this checkpoint cannot publish, so a read that has enough committed data to answer waits for the very close publication it is meant to be independent of. The new regression uses an idle Prompt, so it does not exercise a pending checkpoint. The active path has a similar final wait after the dispatcher loop, where a close does not select the existing cancellation fallback.
Please keep the closing lookup read-only and bounded to the published cutoff, e.g. use the existing TimelineTree configuration query once the branch is closing, while preserving the active owner read and genuine reload error. A regression can hold prompt-state/recovered publication and assert that the closing lookup and a pinned read return the same model while the hold is still armed. This remaining path is a source finding; I did not run that interleaving. Exact CI was in progress at review time.
The CLI, the TUI, the ACP gateway and the Web read a line's adopted configuration through the branch-qualified read added by #1970, at the cursor the attach reply or the window carries, and apply only that line's later configuration events. The reads that paged the line's history backwards with a fixed cutoff and a page cursor together are gone; the App Server refuses that combination as a cursor past the fixed position, so a real daemon never answered them. A server that does not advertise the read no longer has the root's configuration shown for a line: the line reports the limitation and the bar carries no model, and the Web no longer falls back to the directory row's model, which is the root's. The Web takes a move's generation only once the server accepts it, so a move the server refuses cannot discard the completion of a move it accepted; the earlier move still reaches the page, whose centre then matches the server's default branch.
|
#1970 (review) and #1970 (review) The first run ( The next run ( The same run ( This pull request changes the adopted-configuration read in the App Server, session prompt and timeline-tree code, its transport tests, and the related design pages; none of the failing tests or their fixtures is in that set. |
A closing configuration read went through Prompt's recovery, whose final wait does not end when the line closes. The publication it waits for can sit behind the close's own interrupt, and the owner can write a recovery checkpoint while the read runs, so the read waited for the close it must not depend on. Route a line whose own end is committed to the tree's configuration query, and end an owner read's publication wait when the line closes or its scope unloads. The owner path refuses to replay once the phase is closing. Tests hold a recovery checkpoint's publication while a line is ending and while a live read waits on it; both fail before this change.
The committed-end check and the owner lookup are two calls, and a line's end can commit between them. Its scope then unloads before session.service returns, so the read reported the reload or ended error that the committed-end route already answers from the tree. Keep the committed-end check and fall back to the tree when the owner lookup fails and the line's own end is committed; an active line that is reloading still returns its error. Also correct the assertion message of the test's upper bound, which claimed the read ended.
|
Fixed: a closing line no longer reads its configuration through the owner's recovery, and an owner read that waits for a recovery result now ends that wait when the line closes. The closing path still replayed sources through the mounted owner. Its final wait was
An active line under reload keeps New coverage in The route adds no protocol method or field, changes no attach reply, and keeps the lock order: the owner path takes no lock across a wait, and the tree read only queries the store at the published head. |
eric8810
left a comment
There was a problem hiding this comment.
Re-reviewed f961b52a. Checking the line's own end before touching Prompt and cancelling an already-waiting live read address the held-publication hang from my previous review. The recheck after a failed service lookup also closes that lookup race.
- [P2] Keep the live read out of recovery if the line starts closing between the two phase checks.
Prompt::adopted_configurationchecks atprompt.rs:1078, then callsadvance, which checks again atprompt/recovery.rs:1405–1409and entersrecover_sourcesif it now sees Closing. That path can append a recovery checkpoint and expired-context inputs (:750–786) before its final cancellation check. Branch close sets its phase before making the Timeline non-appendable (`timeline_context.rs:736–781)), so the second check can still turn this read into a writer during close. There is no longer a publication hang in that path, but the extra write can delay settlement. Have the model read use an active-only variant that decides at the same phase check that chooses recovery, leaving the shared opening/mutation recovery path intact. - [P2] Gate the closing fixture before it can pass through Ending. In
tests/transport_flow/model_get.rs:776–812the new regression test spawns an idle branch end and polls for the transient Ending state before injecting the source change. Nothing holds the close at that state; it can reach Ended before the poll sees it, or close the Timeline between the poll and the injection. The checkpoint hold cannot prevent that because it only takes effect after the change. The 10s timeout starts after all those waits. Gate the close after its own end is committed but before the Timeline closes, then inject the change, and bound the setup waits.
These are source findings. Exact CI was still running.
zerob13
left a comment
There was a problem hiding this comment.
Re-reviewed f961b52a91407e448a787abe0dea9159ab036da9. The earlier invalid cutoff and wait during closing are fixed. The ownership boundary still has a gap: a configuration lookup admitted just before close can enter write-capable Prompt recovery after the branch phase changes.
The getter checks the phase before calling advance, whose non-active path still replays sources. Cancellation at the publication wait is too late to prevent that replay from enqueueing a recovery checkpoint. An isolated normal-close lifecycle test returned the correct configuration but advanced the committed sequence from 20 to 21; all nine committed model-get tests passed.
Keep the configuration getter on a read-only path at this transition: return the existing cancellation outcome and let TimelineTree answer at its published cutoff, rather than using the non-active recovery path. This is an ownership fix, not a request for another phase check or broader compatibility logic. Exact CI passed macOS, Web and scripts; Linux was still running when checked.
|
Fixed: a configuration read whose line starts closing between the phase checks no longer enters the recovery path, so it cannot append a checkpoint or expire context inputs while the close settles.
New coverage: The closing fixture of |
|
Fixed: a configuration lookup admitted before a close no longer reaches the write-capable recovery path after the branch phase changes. The getter's advance is
The closing fixture of |
eric8810
left a comment
There was a problem hiding this comment.
Reviewed at head 971bde8.
The delta since 313dbfcc is one refinement and its tests. end_committed now decides up front whether the line committed its own end, and such a line is read from the tree at the published head without replaying or waiting. The comment gives the reason and it is the right one: a closing scope may still hold its owner, and that owner may be waiting on a publication the close holds back, so a read that went through the closing scope could wait on the very close it is observing. Checking before the call rather than catching the resulting error is the difference between avoiding the wait and surviving it, and the doc comment on the method now says "fixed, published or requested head" to match.
The test side gained the ability to hand each branch's Timeline to the test and to commit prompt-change facts directly, which is what makes the published-head case reachable without a producer — the kind of coverage this behaviour needs, since a line that has not committed its end is the case that would hang rather than fail.
verify (linux) and ci-ok failed on this head, in the CLI update machinery, which no file of this PR reaches:
update_uses_the_installed_package_and_prefix_without_a_daemon
update_entry::update_reports_a_source_build_and_sends_no_input
staged_update::a_command_another_package_owns_is_never_taken
160 passed; 2 failed
That suite has been red on and off across many heads this week; the counts differ each run (fifteen failing cases, then one, now these), which is what a fixture that installs an updater looks like when the environment misbehaves rather than a regression in a specific path. Nothing here touches it.
Not approving while a required check is red.
Non-blocking: none.
|
One CI detail on |
`do_turn_end` decides a continuation from the fold, then waits on the write guard and on the ending turn's tool-call query. A report input that commits in those windows is folded only after the decision, so the stale continuation is written behind the report turn, drives a turn of its own, and that turn end writes another continuation after the completion request. The evaluator was already created, which is why only the no-continuation assertion failed. After the decision, wait until the Dispatcher has delivered every fact committed at that call and decide again from the fold under the state lock. An open turn, a driving input, an interrupt or a newer turn end makes the old decision none. The wait is the one `write_guard` already makes before a state record. It has no timeout: it is bounded by the facts committed before the call, ends on the same cancellation as that existing wait, and cannot block the Dispatcher because it holds neither the state lock nor a lock the Dispatcher takes, and `do_turn_end` runs in Goal's own task rather than in a Dispatcher handler. The regression test holds the set turn's continuation at its write, starts the report turn, then releases it, and asserts that no continuation follows the request. Fixes #1989
Goal's `testing` hook is enabled by its own dev-dependency, like the hooks of the other crates, so the generated crate graph gains the self edge `dim-goal -> dim-goal`. Regenerated with `cargo run -p xtask -- graph`.
The #1989 flow waited on HeldWrite::arrived without a limit, so a regression that never writes the continuation hung until the job timeout instead of failing the test. Bound the wait to the 15s the test's other waits use.
eric8810
left a comment
There was a problem hiding this comment.
Re-reviewed b909eb51. The model-read close fixes from 971bde8f are unchanged: the read no longer enters write-capable recovery when close wins, and the fixture gates the closing phase instead of polling for it. The new Goal change catches the case where the report turn commits before the second decision.
[P2] Keep #1989 open until the continuation precondition holds at append. The remaining race is not just a few instructions. After the second fold check, Goal calls write(input).await. The continuation carries a submission ID, so Timeline::input_checked awaits a submission lookup before taking the commit lock. If another input commits during that await, the loop refreshes its deduplication cutoff and retries; it never refreshes Goal's decision. A report input can therefore still overtake a continuation on this head, particularly if the store lookup is delayed. The new fixture holds the decision before the recheck, so it can't detect this interleaving.
Please make the continuation append conditional on the head the decision covered, and re-evaluate (rather than unconditionally retrying) if that head has changed. A focused regression should gate after the final decision, before append, and then commit the report input. If this PR is intended to ship only the narrower mitigation, please separate it from the configuration read and leave #1989 open. This is distinct from #1998's missed evaluator.
The remaining append race is a source finding, not a locally reproduced failure. Exact CI was still running when checked.
|
I accept the finding: the remaining window is between Goal's second decision and the continuation append, and it is wider than a few instructions. The continuation carries a submission ID, so This PR was merged with the narrower mitigation, and the append race is tracked in #1989, which stays open. The regression in this PR holds the decision before the recheck and does not cover that interleaving. |
|
The quota and Those attempts were still red on This does not claim the quota messages as a confirmed cause of the first attempt. A clean |
Problem
A non-root line's adopted model is not reachable through a bounded read.
session.attachanswers the root's configuration, a transcript window excludescontext/configured, andsession.historyis a single-line stream whose cursor cannot mix an ancestor's adoption with the line's own sequence. A client therefore cannot restore the model a child line adopted without scanning history, and the history-based attempt was refused by the server's fixed-position check.docs/design/clients.mdrequires the adopted model to come from an owner read with a branch cutoff, not from a transcript window: https://github.com/arcships/dim/blob/main/docs/design/clients.mddocs/adr/021-reads-follow-the-state-owner.mdstates the same rule for current state outside a window: https://github.com/arcships/dim/blob/main/docs/adr/021-reads-follow-the-state-owner.mdMethod
session.model.get {sessionId, branchId, through?}answers{branchId, through, configuration: {model: {providerId, modelId}, capabilitySnapshot?, modelPreferences?} | null}.branchIdis required;throughpins an earlier committed cutoff of that line and is omitted to read its head.The method is listed in the built-in
hello.featuresand admitted bysession_execution, likesession.attach; it is not part ofLOCAL_EXECUTION_METHODS, so--mock-modeland non-product sessions can call it.configurationis the value the line's latestcontext/configuredcarries, withmodelPreferencesderived exactly as the event projection derives them.Watermark
The returned
throughis always the requested line's own committed cutoff; it is never the sequence of an ancestor'scontext/configured.A child line numbers its own facts from 1, so a client that took a parent's adoption sequence as the cutoff would drop every later change on the child.
The cutoff reported by an open line is the cutoff of the state it answers from, so a pinned read at that value always answers the same configuration. A read that waits for the Dispatcher to reach the committed head answers at that head, or at the sequence of a later source fact the owner has already applied instead. A line whose own end is committed answers from the tree at its published head: a fact whose publication is still pending is not visible to any read, so the line does not answer past it.
Clients apply only that line's
Configurationevents whosesequence > throughand refresh by calling the method again withoutthrough.Owner
An open line reads from
Prompt, the owner of its adopted configuration: the read advances the Dispatcher to the committed head first, so acontext/configuredcommitted just before the call is included rather than missed, and it takes the configuration and the projection's applied cutoff under one lock, so the pair cannot come from two different states.A line whose own
branch/endis committed does not read through the owner, even while the owner is still mounted. It reads throughTreeCommandswith the sameChain + context/configured + Lastquery thatPrompt::loaduses, bounded by each ancestor's inherited cut. That covers an ended line, a caller-supplied cutoff, and a closing line whose recovery would otherwise wait for aprompt-state/recoveredpublication the close may be holding back; the read is bounded by the published head and answers it asthrough.The owner's configuration read never writes. A read that has passed its phase check and meets a close before it advances answers the existing cancellation at that second check, at the same point that would otherwise choose recovery, and the App Server turns it into the same tree read at the published head. The shared opening and mutation path keeps its recovery unchanged; only the configuration read takes the active-only advance, so a close that lands between the checks cannot turn the read into a recovery write.
An active line whose services are reloading has no committed end and keeps its reload error instead of being answered from the tree.
An ended line reads its fixed head and is not reopened; an unknown line answers
session_invalid_inputforUnknownBranch.The App Server only routes the call and projects the capability read; it owns no configuration state. Lock order is unchanged and no lock is held across an await.
Tests
crates/dim-app-server/tests/transport_flow/model_get.rscovers a root with configuration A and a child line with B, over a root head far above the child's sequence range so a borrowed ancestor cutoff would be visible.The child's own cutoff stays below its branch point, and its later adoption is above the earlier cutoff.
It also covers an ended line at its fixed head and at an earlier cutoff without reopening it, an unknown line, and a closing line whose end the parent has not recorded yet.
Two controlled interleavings pin the pair, with no sleeps: a read held after it captures the head while a later adoption is applied, and the Dispatcher held before a committed adoption while the read reports it has to wait. Each asserts that a pinned read at the returned cutoff answers the returned configuration.
A read that has passed its phase check while its line starts closing answers the adopted model, and a pinned read at the returned cutoff answers the same model; the test also asserts that the line's committed sequence did not move, so the read appended no recovery checkpoint. Before the change the read replayed the pending source and moved the sequence.
A closing line is read while the publication of its close interrupt is held, with the owner still mounted: the unpinned read answers the adopted model, the returned cutoff succeeds in a pinned read, and that read answers the same model.
A closing line is also read while the publication of its recovery checkpoint is held. The close is stopped after its phase became Closing and before its Timeline closes, the change is injected above the line's own end, and the owner writes the checkpoint the hold stops; every setup wait and the read have an upper bound. The unpinned read answers the adopted model with a pinned read at the returned cutoff answering the same model.
A live read that waits for a recovery result is then followed by the Session close that closes its line: the read ends and answers from the tree.
A reload of a Session row, held before the replacement starts, shows an active line answering
service_reloadingwhile it stays unloaded.The
hello.featuresentry is asserted on a mock-model server, and the same server answers the method without a product home.Compatibility
Old servers do not advertise
session.model.get. The attach reply describes the root's configuration even when itsdefaultBranchnames another line, so a client uses it for the root alone and reports the limitation for every other line instead of presenting the root's configuration as another line's.No client changes are included here; the client use of this method follows in #1963.
Also narrows #1989
This PR narrows the window of the goal evaluator failure tracked by #1989, which failed the Linux verify job on this branch and is unrelated to
session.model.get. That issue stays open: the continuation append is still not conditional on the head the decision covered.Goal::do_turn_enddecided a continuation from the fold it had read, then waited for the write guard and for the ending turn's tool-call query. A report input that committed in one of those windows was folded only after that decision. The stale continuation was written behind the report turn, drove a turn of its own, and that turn end wrote another continuation after the completion request. The evaluator had already been created, so the flow test failed only on the assertion that no continuation follows the request.The change waits, after the decision, until the Dispatcher has delivered every fact committed at that call, and decides again from the fold under the state lock. An open turn, a driving input, an interrupt or a newer turn end makes the old decision none. The wait has no timeout: it covers facts already committed, ends on the same cancellation as the existing write-guard wait, and runs in Goal's own task, so it cannot block the Dispatcher.
The second decision and the continuation write are separate steps, and the write awaits before it commits. The state lock is released before the continuation input commits, and the continuation carries a submission ID, so the append looks that submission up before it takes the commit lock. A report input that commits during the lookup makes the loop refresh its deduplication cutoff and retry, which does not refresh Goal's decision, so the continuation can still be appended behind that input. The window therefore spans that lookup.
https://github.com/arcships/dim/blob/main/crates/dim-goal/tests/goal_product_flow.rs holds Goal after the first decision and before the second one, starts the report turn, then releases the hold, and asserts that no continuation follows the request; the test fails before this change and passes after it. It does not reach the interleaving at the append itself.
A separate race is reachable when a queued user input starts the next turn at the report turn's end before Goal's decision for that turn end runs: the request is then never evaluated. It is tracked in #1998 and is not changed by this PR.