Skip to content

fix(herdr-core): keep the Herdr app's pin changes the pin bridge overwrote - #2753

Merged
devswha merged 2 commits into
mainfrom
fix/issue-2725
Nov 4, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/issue-2725

Conversation

@devswha

@devswha devswha commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Fixes #2725

Three ways the herdr-core pin bridge overwrote a pin or unpin made in the Herdr app:

  1. App unpin while our pin write awaits hc's answer. The answer no longer records the write's own value once the write's labels event came back: that event (marked heard) and any later one of the app's already say what the label is. The echo of our write now also records the agreement, so the app's change after it is taken as the app's.
  2. App unpin that preferences.json could not save. refused now holds an unpin the list could not take as well as a pin, so no label is written for that terminal meanwhile and it is tried again on the next list change.
  3. Lost preferences.json with an agreed pin. The snapshot's terminals are all known before any is settled, and a list started from no list holds every agent pinned in the app, so an agreed pinned terminal is not then taken as unpinned.

Validation

  • New tests in server/herdr-core/pin-label.test.ts, one per case; all three fail on origin/main (cf40bb0) and pass here.
  • bun test server/herdr-core/: 115 pass.
  • bun run check fast: all ok (unit 11080 pass, 0 fail). full not run.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between cf40bb0 and 6ed728c.

Files selected for processing: 3
  • changelog.d/herdr-core-pin-overwrite.md
  • server/herdr-core/pin-label.test.ts
  • server/herdr-core/pin-label.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devswha

devswha commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Review rounds (omo + Codex Terra, adversarial):

  • Round 1 at b75754f: omo BLOCK, Codex 3 MEDIUM, all reproduced as failing tests at that head and fixed in 6ed728c:
    • a late labels event of an already answered write overwrote a newer agreement (echo now carries answered; only an unanswered write's echo records the agreement);
    • with preferences.json lost and more than MAX_PINS agents pinned, agreed pins past the started list were unpinned (leftOut, settled like an unagreed pin);
    • a first app pin that could not be saved while no list existed stayed lost until another event (the subscriber retries refused before its no-list return).
  • Round 2 at 6ed728c: omo CLEAR. Codex confirmed the three fixes and left one edge, not fixed here (one extra round only): leftOut lives in memory, so after a reconnect or restart an agreed pin that was past a full started list (500+ pinned agents after a lost preferences.json) can still be unpinned. Needs more than 500 pinned agents; left as a note.

Checks at 6ed728c: bun run check fast all ok (unit 11083 pass, 0 fail); full not run. CodeRabbit was rate-limited and did not review this PR.

@devswha

devswha commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Merge note: merged on the omo review (CLEAR at this head), Codex Terra (no HIGH; reproduced findings fixed, the rest listed in the PR comments) and green checks. CodeRabbit did not review this head (rate-limited or skipped).

@devswha
devswha merged commit 2788f2d into main Nov 4, 2026
23 checks passed
@devswha
devswha deleted the fix/issue-2725 branch November 4, 2026 14:30
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.

herdr-core: two rare cases where a pin from the Herdr app is overwritten

1 participant