Repository navigation
Tell the CLI why a restart was refused - #961
Merged
Merged
Conversation
Restarting a finished loop was refused, but the refusal went to every connection and the CLI waited only for a graph change, so it printed an unrelated graph or timed out with exit 75. The refusal now answers the asking connection, the CLI reports any error it is sent, and status shows a finished loop's ending instead of its open session's presence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: scgopi <scgopireddy@gmail.com>
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.
Problem
graphcode node restarton a finished loop did nothing, and said nothing about why. Seen on 0.1.84-beta2 with a Copilot child that had reported its goal met:restartNoderefuses a resolved loop by design, but sent the refusal as an error to every connection.runAndPrintGraph, whichnode restart,stop,delete,createand edge verbs use, waited only for.graphChanged. A refusal changes nothing, so the CLI either printed the graph from an unrelated broadcast (exit 0, looks like success) or timed out with exit 75, "may still have been applied".graphcode statusprinted the session's presence (awaitingInput) over the loop'ssucceededstate, so the finished loop looked restartable.Fix
GraphStore.refuse(_:to:)sends a refusal to the CLI connection that asked, asmailroomInboxalready does, and falls back to the broadcast when there is no CLI requester.restartNodeuses it for "no loop" and "has finished".runAndPrintGraphalso waits for.errorOccurredand fails with its message, as the other verbs inmain.swiftand the remote Python CLI already do.statusprints a resolved loop's state rather than its presence. The remote Python CLI already prints the stored state.Evidence
Isolated daemon and CLI built from this branch, with a loop edited to
succeededon disk:node restartgraphcode: Finished has finished — there is no session to restartnode restarton an unknown idgraphcode: no loop 00000000-… in this graphstatussucceeded turnBased FinishedRED: xcodebuild test -only-testing SessionRestartTests and GraphcodeCommandTests on main's sources -> exit 65, 47 tests, 2 issues: the bystander received the refusal, and status printed the presence
GREEN: xcodebuild -scheme graphcode test -> exit 0, both new tests passed
REGRESSION: xcodebuild -scheme graphcode test -> exit 0, 2353 tests, 2352 passed, 0 failed, 1 skipped; make check -> exit 0, 0 serious; graphcoded and graphcode-cli builds -> exit 0; cli-smoke on a fresh SwiftPM build -> exit 0
Not covered
stopanddelete. The CLI now reports those too, so any error broadcast while a CLI waits ends that CLI, as it already does fornode sendandmail post.resumeSession.