Skip to content

fix(hub): settle a failed helper notice so it never blocks the next - #49

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-11918-stop-one-undeliverable-helper-notice-from-blocking-the-rest
Nov 2, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-11918-stop-one-undeliverable-helper-notice-from-blocking-the-rest

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

When a helper agent (writer, designer or coder) finishes or fails with an unanswered assignment, the hub sends the project's coordinator a note saying so. Interchange doesn't send this notice itself yet, so the hub has a small loop that checks ended runs in order (ended_at), one at a time across the hub.

  • The bug: If one notice couldn't be delivered (mailing the coordinator returned a 5xx error) or its stored mail was malformed, the loop retried that same oldest run on every 5-second pass forever. Every notice queued behind it—across every project on the hub—was stuck, so coordinators never heard that their helpers had finished or failed.
  • The fix: A notice whose mail fails is now marked settled (notified: false), logged, and skipped on future passes so the loop moves on to the next one. Malformed mail headers/MIME are caught inside the same error handling so they can't crash the pass either.
  • Test: An e2e test (test/e2e/specialist-end-notices.test.ts) on real Postgres with an older notice whose coordinator mail fails (500) plus a newer one with malformed multipart mail. Fails on main, passes with the fix.
  • Why this is a stopgap: Once the hub accepts a mail, Interchange already queues and retries delivery. Longer term, run-ended notices belong in the harness itself (Interchange onFailure / pushing the notice back) rather than a hub polling loop.

Supersedes #43.
Closes CL-11918

@linear-code

linear-code Bot commented Nov 1, 2026

Copy link
Copy Markdown

CL-11918

@corbits-triage

corbits-triage Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Triage: Unsure

Asking a maintainer about:

  • added code matches a code pattern: test/e2e/specialist-end-notices.test.ts:188 A hand-rolled sleep; wait on an event, or on an Interchange wait, retry or timeout where one exists.

Changed since the last verdict (Fail at a5dfe01): 1 new commit.

@corbits-triage corbits-triage Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triage requests changes:

  • Invented fallbacks: added code matches a code pattern

@TheGreatAxios
TheGreatAxios force-pushed the cl-11918-stop-one-undeliverable-helper-notice-from-blocking-the-rest branch from a5dfe01 to c2a47c3 Compare November 1, 2026 18:41
@corbits-triage
corbits-triage Bot dismissed their stale review November 1, 2026 18:43

Nothing triage asked to change still fails, so this request no longer stands.

@TheGreatAxios
TheGreatAxios added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 89a478e Nov 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant