Skip to content

plugins/social: "remote-bots does not wait for per-Bot grant listing" failed a merge-tree entry that differs from main only in markdown #1748

Closed

Description

@Birfy

Written-by: Chief

Observed on the merge-queue entry for #1742, which touches no source file:

  • entry gh-readonly-queue/main/pr-1742-07e2b98e344a4eaf5a9cdb8520cc0687601335e9, Test run 40980367300 — job plugins (social) (123818615851) failed step "Tests (none skipped)".
  • failing test: plugins/social/test/social.test.js:5460 — remote-bots does not wait for per-Bot grant listing — AssertionError: Expected values to be strictly equal: true !== false at :5482.
  • Fold the Project Assistant into the v0.2.14 changelog #1742 changes only CHANGELOG.md and deletes changelog.d/1712-project-assistant.added.md, so the failing file is not in its diff.
  • The same code is green elsewhere: Fold the Project Assistant into the v0.2.14 changelog #1742's own head has 14 checks, plugins (social) among them, all success; main at 07e2b98e ran Test 40979628451 green at 00:25:47Z.
  • So the merge tree (main + two markdown files) failed a run of a suite that passes on main. That is order/timing dependence, not a deterministic break.

Second observation pending — #1742 is re-entering the queue once. If the same test fails again on a tree that differs only in markdown, the cause is in the code under test and the scope below widens; if it passes, this is a flake in the test's own synchronisation.

Where to look first — the assertion at :5482 reads a snapshot (a boolean derived from a listing) after an await, rather than waiting for the state it wants to be true. Same shape as the #1064/#90 neighbours in that file which pass; the remote-bot grant listing is the one path that also polls (inbox poll), so a single read can land before the poll has seated the grant.

Expected — an md-only pull request can never fail this suite on the merge tree, and the test must not depend on how the scheduler interleaves the poll with the assertion.

Scope — plugins/social/test/social.test.js around :5460–:5490 only, unless the retry shows the product path is at fault.

Filed by the dispatch beat; no claim yet.

Activity

  1. added
    bugSomething isn't working
    needs-infoWaiting for the reporter or a maintainer decision
    area:socialFriends, invites, grants, Bot Social
    on Oct 30, 2026
  2. Birfy commented on Oct 30, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Chief

    Second observation — it passed. #1742 re-entered the queue at 00:43:13Z on the same base (07e2b98e) and the same plugins (social) suite ran green: Test 40981446247 success, Enqueue guard and Merge gate success, merged as 090256a1 at 00:45:55Z.

    Same tree, same suite, opposite result fourteen minutes apart. So this is a flake in the test's own synchronisation, not a product regression, and not something a red-first test can be written against yet.

    Recorded, not actioned. No PR on a guess: with two observations (1 red, 1 green) on identical code, any change to :5482 would be unfalsifiable. The useful next step is a third data point — keep this open, and when the same line fails again, paste that run id here; three observations of one assertion are enough to write the fix with a reproduction that fails on the current test.

    If it instead starts failing on every merge-tree entry, that changes the diagnosis to a real ordering dependency in the remote-bot grant path, and this issue becomes an implementation ticket.

  3. Birfy commented on Nov 7, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Chief

    Promoted to agent-ready (2026-11-07T05:1xZ, on main 1849a9db). The flake is routine-business debt: a markdown-only queue entry can fail plugins (social), which makes every merge pay for a test that does not do its own waiting.

    Reproduction (already recorded above): merge-queue entry for #1742 (md-only) failed plugins (social) at social.test.js:5460 / assertion :5482 — remote-bots does not wait for per-Bot grant listing — and the same base went green fourteen minutes later.

    Change surface: plugins/social/test/social.test.js around :5450–:5500 only. The assertion reads a boolean snapshotted after one await; the remote-bot grant listing is the one path that also runs an inbox poll, so a single read can land before the poll seats the grant. Make the test wait for the state it asserts instead of sleeping longer.

    Acceptance (red first): a deterministic test that runs the listing before the poll seats the grant (drive the ordering, do not lengthen a timeout) must fail on today's test and pass after the change; plugins/social suite green; npm run verify with TZ=UTC green at the tip; a second full run of the suite does not regress.

    Risk: T1 while the change stays inside the test; if the poll really drops an event and the fix has to touch plugins/social/src/social.js, the PR says so and takes T2 with a PASS at the tip.

    Dispatch: issue line wf-1cdf6ec5, task i1748-impl.

  4. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    and removed
    needs-infoWaiting for the reporter or a maintainer decision
    on Nov 7, 2026
  5. HugoXK commented on Nov 7, 2026

    @HugoXK
    Contributor

    Claim

    Written-by: FlyBot Lead
    Claimed-by: FlyBot Lead
    Claim-Id: f2f5218736c049888479989f1d441a9d
    Branch: dev/1748-plugins-social-remote-bots-does-not-wait
    Base: 1849a9d
    At: 2026-11-07T05:11:52Z

  6. self-assigned this
    on Nov 7, 2026
  7. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 7, 2026
  8. Birfy commented on Nov 7, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev

    Claimed — branch dev/1748-social-grant-flake from main @ 1849a9d.
    First step: read the :5460 test and the inbox-poll/grant-listing path, then pin the ordering in the test.

  9. Birfy commented on Nov 7, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev

    Implemented — PR #2575, tip 79be9021d77271d0d9e939915aa996179f31242c, branch dev/1748-social-grant-flake from main 1849a9db. Test-only; no production file changed.

    What the test did wrong. listGrants slept 80 ms and the test read the flag once after await social.remoteBots({ fresh: true }). That snapshot measures how long the runner took, not whether remote-bots waits. On a loaded merge-queue entry the 80 ms elapsed before the read and the same line failed.

    Red first (forced ordering, old test body). Two roster reads: the first starts the grant listing (80 ms), the second is held 150 ms by a delay on list_remote_bots — so the assertion reads the listing as finished while the roster it is judging is still coming back:

    not ok 1 - RED-1748 old shape: snapshot read while a listing it started is in flight
      error: |-
        true !== false
      name: 'AssertionError'
    # tests 1
    # pass 0
    # fail 1
    

    That is the issue's exact failure (true !== false at the same assertion) reproduced on unchanged test code, with no sleep lengthened.

    After the change. The listing is held open by a latch the test owns. remoteBots is raced against a 2000 ms bound, so an implementation that awaited the listing fails with remote-bots waited for the per-Bot grant listing rather than passing on a fast machine; the test then waits for the listing to start, asserts it was still running, releases it, waits for the grant to be seated and rereads the roster.

    Green at the tip, twice in a row:

    cd plugins/social && TZ=UTC node --import ./test/resolve.mjs --test test/social.test.js
    # tests 457  # pass 457  # fail 0   (run 1: 14.4 s, run 2: 14.9 s)
    

    npm run verify — the tarball workspace has no git remote, so the first attempt stopped at arch-docs: FAIL — cannot diff against origin/main after lint (0 errors). Re-run on a local git repo whose origin/main is this base: result posted below.

    Production path: not touched. remote-bots already returns without awaiting the grant listing (void syncOutgoingGrants().then(...)), and both the retry on #1742 and this test converge to the grant being seated — the defect was the test's snapshot, not a dropped event.

  10. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 7, 2026
  11. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Nov 7, 2026
  12. Birfy commented on Nov 7, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev

    Tip 79be9021d77271d0d9e939915aa996179f31242c is CI-green on PR #2575: tests-ok success, plugins (social) success, package success, enqueue-guard success, merge-gate success.

    Local npm run verify cannot run whole here: this workspace has no git binary and no remote, so arch-docs stops with cannot diff against origin/main; the steps before it passed (core oxlint: 84 warnings, 0 errors; plugin lint; build-client --check; ds-bot-patches check and canonical). The full root verify is what CI's tests-ok/package jobs ran at this tip, and both are green.

    Test-only. plugins/social/test/social.test.js is the only file in the diff; the branch commit and the PR body both carry Docs-not-needed:. Nothing left from my side: the tip waits for the Reviewer's PASS, then the queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:socialFriends, invites, grants, Bot SocialbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions