Repository navigation
Flows that wait say what they wait for: Hunch runs, define-with-an-agent, resume checks, wizard discard, promotion - #287
Merged
Conversation
…ent, resume checks, wizard discard, promotion - Hunch: `HunchTrainingRun` (idle, starting, running, stopping) replaces `training: Double??`. Stop now reaches the detached run (withTaskCancellationHandler), the runtime checks for it before adopting, and a run asked to stop never adopts its head even when it finishes anyway. Late progress is ignored. - `AgentConversation` (HeedCore) and one helper for both "define with an agent" flows (a goal's part, a persona) replace six loose fields each. Events, replies and failures for a conversation that was closed or replaced are dropped by id; a client made after its conversation was closed closes itself. - Resume offer: `ConversationChecks` (unknown, checking(generation), present, missing) replaces `conversationOnDisk: [String: Bool]`; an older check reporting after a newer one began is ignored. - Wizard discard: the confirmation passes what it said (Archive or Delete); `GoalOps.discard(expecting:)` refuses when the store would now do the other. `WizardActivity` cancels a running plan turn on discard, and a turn's reply arriving after that writes nothing. - Promotion: `PromotionFlow` holds the popover's promotion and its handoff ask in one value (no ask without a promotion, none for another session); `HandoffAsk` has an id and a delivery lands only on the ask it was sent for. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Part 3 of fix/explicit-states (code-health plan, PR 12), after #283 and #285. Branched from main with both merged.
HunchTrainingRun(idle,starting,running(fraction),stopping) replacestraining: Double??. Thetraininggetter keeps the pane andHunchStatusas they were.stopTrainingcancelledtrainTask, but the work runs in aTask.detachedthat never sees that cancellation. Stop is now passed on withwithTaskCancellationHandler.run.isActiveinstead of looking attrainTask.AgentConversation(HeedCore/ACP) holdsid,phase(connecting,ready(session),turn(session, buffer),failed),client,rootandpaths. It replaces five fields each on WizardBrowser and PersonaLibraryBrowser.AppModel+AgentConversation.swift, where each had its own copy.ConversationChecks(unknown,checking(generation, last),present,missing) replacesconversationOnDisk: [String: Bool].ResumeBanner.offer(..., conversation:)takes the check.receive:.agentSessionnow callsconversationChecks.forget.GoalOps.discard(goal:expecting:now:)throwsdiscardChangedand changes nothing when the store would now do the other, so a dialog that said Archive never deletes.WizardActivity(idle,thinking(id),discarding) cancels a running plan turn on discard. A turn whose reply arrives after that writes nothing to the goal, both on arrival and after the plan save it awaits.PromotionFlowholds the popover's promotion and its handoff ask in one value.goalPromotionandpromotionHandoffare now accessors on it.HandoffAskhas anid.deliverHandoffAskused to match on the session only; a delivery now lands only on the ask it was sent for, not on a newer ask for the same session.Verification
mise run fmtis clean.swiftlintis clean on the changed files; the full lint ran clean before two closure-position warnings were fixed.swift testpassed the whole suite (2586 tests) on the branch before its last rebase. After rebasing onto main with Loads and tests say where they stand: Load<T> for diffs and threads, TestRun, coalesced GitHub syncs #283 and One stack of dialogs: whether a click may reach a list or a terminal is one question #285 merged, it builds and the targeted suites pass: 90 tests (the new FlowStateTests plus GoalDiscard, ResumeBanner, SessionHandoff, GoalPromotion and Hunch). The full suite was not rerun after that rebase.Tests/HeedCoreTests/FlowStateTests.swift, plus one in GoalDiscardTests. They cover:stoppinginfinish; drop the generation check; drop the ask-id check;thoughtaccepting any turn; drop the id check inAgentConversation.update; drop theexpectingcheck. The generation mutation first survived; the test was strengthened, and it fails now.Not tested
🤖 Generated with Claude Code