Skip to content

Deliver queued GOA tasks to sessions on other hosts and sessions already done - #30

Merged
enowdev merged 1 commit into
mainfrom
fix/goa-queued-delivery
Nov 4, 2026
Merged

enowdev merged 1 commit into
mainfrom
fix/goa-queued-delivery

Conversation

@enowdev

@enowdev enowdev commented Nov 4, 2026

Copy link
Copy Markdown
Owner

A task delegated to a busy session shows as queued, but often never reaches it.

Cause

  • Another host's session: MethodGOAWorker (daemon/rpc_goa.go:18) updated the board and stopped. Only a change on GOA's own host called goaDeliver (daemon/goa.go:204).
  • The watch didn't cover it: queuedCanGo (daemon/goa_stall.go:117) required StateStale, so a session that said done was skipped, on any host. So was a session with no state after a restart.
  • Silent failure: a failed delivery marked the task failed without telling GOA (daemon/goa_tasks.go, goaDeliver). A task whose session was gone or hibernated stayed queued for good.

TestGOAQueuedTaskReachesAnotherHost fails without the fix: never: the first went in.

Change

  • A worker's change takes the same path whether heard locally or from the app (goaWorkerSeen), so its turn's end delivers.
  • The watch also delivers to a session that is done, or to an agent with no state and a free prompt, once its screen has been still for 20 seconds with nothing running.
  • One at a time: the next task goes only once the one before stops running, under a lock from claim to typing.
  • What can't go in fails on the board and GOA is told. A failed typing isn't retried, since it may have gone in. A lost host keeps the task queued and tells GOA once. A hibernated session is brought back first.

No protocol change, so an older daemon on another host works as before.

Tests

On enowxlabs: the whole daemon package passes, and the new tests pass 3 of 3 runs: another host, one at a time, already done, restart with a queued task, and what can't go in. TestHibernateByHandAndWake and TestAlwaysAllowHibernateAndClose fail intermittently here, on main too.

Not run: a real Mac GOA with a real worker on another host, or a real update between queueing and delivery. The restart test uses a stand-in agent.

Touches no go.mod, version/ or cloud/, so merging doesn't deploy the cloud.

🤖 Generated with Claude Code

…ady done

Only a change of a session on GOA's own host gave a queued task. The app's word
for another host's session (goa.worker) moved the board and stopped there, and
the stall watch skipped any session that said it was done, so a task queued for
another host's session never went in. Neither did one for a session whose turn
ended before the task was queued, or one brought back by a restart with no state.

Tasks now go one at a time, the next only once the one before stops running. What
can't go in fails on the board and tells GOA, which a failed typing didn't do, and
a task queued on a session later hibernated brings it back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@enowdev

enowdev commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Its commits are in main through the 0.7.0 release merge (#40, e306b3b).

@enowdev
enowdev deleted the fix/goa-queued-delivery branch November 5, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant