Conversation
notBefore was checked on the winner of oldestQueued(), so a goal scheduled for later sitting at the head of the FIFO queue blocked every due goal behind it until its time arrived. Filter not-due goals out of the selection instead, so notBefore parks one goal rather than the whole queue. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The sweep offers an unfinished thread as a hint, but Hermes may ignore it and propose something unrelated; sourceThreadId was stamped regardless, so the card (and the goal it becomes) durably claimed a thread it never touched. Stamp it only when the proposal output cites the id, and drop it entirely from the preflight-blocked card, where Hermes never ran at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.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.
Two independent correctness fixes in the guided-autopilot proposal path, each with a
regression test. No behaviour is added — both narrow a case where the current code
does something the design does not intend.
1. A scheduled goal stalls the whole queue
AutomodeDriverpicked the FIFO winner witholdestQueued(...)and then checked thatgoal's
notBefore:So a single goal scheduled for tonight, sitting at the head of the queue, blocks every
due goal behind it until its time arrives — the driver returns on each tick without
looking any further.
notBeforeis now filtered inside the selection, so it parks one goal rather than thequeue. Reproduced first as a failing test (
dispatches a due goal queued behind a not-yet-due one); the existingkeeps a proposal queued until its not-before timeteststill passes unchanged.
2. A card can claim a source thread it never touched
The sweep offers an unfinished thread to Hermes as a hint ("propose the smallest safe
continuation if it is still relevant"), and Hermes is free to ignore it and propose
something unrelated.
sourceThreadIdwas stamped onto the card regardless, so theproposal — and the goal it becomes — durably recorded a source thread with no connection
to its content.
It is now stamped only when the proposal output cites the id, via a small pure helper
(
citedSourceThreadId) with three unit tests. It is also dropped entirely from thepreflight-blocked card, where Hermes was never spawned, so the claim could never be true.
Verification
bun run fmt:check(repo-pinned oxfmt),bun run lint(0 errors),bun run typecheck(14/14)bun run testgreen across all 22 packages🤖 Generated with Claude Code