Repository navigation
fix(members): preserve relay-recorded agent classification - #2363
Open
jpeedikayil wants to merge 1 commit into
Open
jpeedikayil wants to merge 1 commit into
jpeedikayil wants to merge 1 commit into
Conversation
Read optional agent markers from the verified roster independently of permission roles. Keep unknown identities in neutral member groups and preserve existing action restrictions and owner-read limits. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Josiah Peedikayil <174502694+jpeedikayil@users.noreply.github.com>
joahg
approved these changes
Nov 5, 2026
joahg
left a comment
Member
There was a problem hiding this comment.
🤖 Read the roster-tag parsing and the Members dialog grouping; the agent tag is optional, pubkey-validated and must match a rostered role, so older rosters degrade to current behavior. The PR body says the relay-side agent tag contract still needs maintainer agreement, so don't merge ahead of that. Merge state is DIRTY, needs a rebase.
matt2e
added a commit
that referenced
this pull request
Nov 17, 2026
## Why Two WebKit browser journeys fail now and then in CI on branches that cannot affect them. One failed test fails its shard and `CI required`, because the Playwright config sets `retries: 0`, and the only recovery is a manual re-run. Both are races in the tests themselves, not product defects. - `tests/browser/relay-recovery.spec.mjs:9`, "relay reads recover automatically after the network returns". - `tests/browser/solo-legacy-invitation.spec.mjs:49`, "Outbox Retry reconciles a recorded then removed Solo invitation without replaying it". This PR is test-only. It changes those two spec files (+26 −9) and no production code. No journey is added or removed. Both failures surfaced together in one CI run on #3677 (run 43995560292, attempt 1). That PR did not cause them. It renames a presence label in the profile panel, which neither journey opens or asserts. The failed jobs passed on re-run at the same commit, and the same failure signatures appear on other branches, listed below. ## relay-recovery: the wait was satisfied by another community's read **The failure.** `toBeInViewport` reports "element(s) not found" for the connection notice, on WebKit shard 5/18. Example: run 43995560292, job 133746953063. **The race.** The test cuts the network, waits for the open channel's catch-up read to meet the outage, jumps the clock 30 s, and expects the connection notice to stay up. The wait accepted a refused `/query` from any community. In the CI trace the second community's background reads were refused first, so the wait passed on one of them and the clock jumped before the open channel's own read was refused: | ms after the outage began | Event | |---|---| | +26 to +77 | First five refused requests, all for the second community | | +124 | The wait passes, on a second-community `/query` | | +146 to +271 | `clock.fastForward(30_000)` | | +272 | Notice visible | | +545 | First refused `/query` for the open channel's community | | +881 | The failing assertion starts. The notice is gone and stays gone for 10 s | `createRecovery` in `src/features/relay/recovery.ts` hides the notice as soon as no source is failed or busy. Once the live socket returns there is an instant where nothing is failed, just before the open channel's read is queued and refused. That later refusal starts a fresh 30 s notice timer, which the test's clock never advances. **Why now.** #3459 added a background session for other communities, which is the source of the early second-community refusals. In a sweep of CI runs from 14 to 17 Nov, this exact signature failed in 5 of the 126 completed runs created after #3459 merged, and in none of the 660 completed runs created before it. **The fix.** The wait now passes only when a refused `/query` for the primary community carries the open channel's timeline head. The filter test is the one `isChannelHead` uses in `src/features/relay/session.ts`, `depth_limit` clause included. The comment above the wait already asked for this. Once that read is refused, the channel's head stays failed or pending while the outage holds, so recovery cannot go idle and the notice cannot clear before the network returns. ## solo-legacy-invitation: a reload while the app was still booting **The failure.** `page.reload: WebKit encountered an internal error`, on WebKit shard 6/18, followed by the fixture's console-error check failing on the resulting "Failed to load resource" message. Example: run 43995560292, job 133746953195. **The race.** Each colour-mode pass did `goto`, a `localStorage` write, then `reload`. In the CI trace the reload began 39 ms after `goto` resolved, while the app was still booting. The trace shows the in-flight boot requests cancelled at that moment, then the document request hanging 3.5 s and failing. #1972 diagnosed and fixed the same pattern in `settings.spec.mjs` and `account-profile.spec.mjs`, but not in this spec. **The fix.** As in #1972, the mode is written by an init script before the document loads, and the boot reload is gone. The second pass adds a second script. Scripts run in the order added, so the last mode wins. The reload the test is about, after Retry, is unchanged. The existing `data-color-mode` assertion still proves each pass booted in its mode. **Known limit.** The trigger is established from the trace and matches #1972's diagnosis. The reason WebKit fails the document request is not established. ## Occurrences on other branches From a sweep of 1,196 CI workflow runs created between 2026-11-14 01:25Z and 2026-11-17 01:49Z, excluding the #3677 run. History before 14 Nov was not swept. The 12 Nov run was found by hand. | Signature | Other occurrences | Where | |---|---|---| | `relay-recovery.spec.mjs:9`, line 83 on `main`, `toBeInViewport` "element(s) not found" | 4, all WebKit 5/18 | Runs 43969555290 (#3050), 43988980663 (#3035), 43990605700, 43991562525 (#3043), between 16 Nov 22:35Z and 17 Nov 00:57Z | | `solo-legacy-invitation.spec.mjs:49`, `page.reload: WebKit encountered an internal error` | 0 in the window, 1 older | Run 43294609776 attempt 1 on #3400, 12 Nov, job 131450781682 | One more run failed `relay-recovery.spec.mjs:9` at other lines: run 43683311686 on #3551's own branch, which rewrites the test's navigation. It is not counted above. ## Evidence All local: macOS 27.2, Playwright 1.63.0, on `23d1d7045b` plus this change, with `--no-deps` and the config's two workers. | Check | Result | |---|---| | relay-recovery, forced CI ordering, previous wait | 20 of 20 fail, 10 Chromium and 10 WebKit, each at the `toBeInViewport` assertion with "element(s) not found" | | relay-recovery, forced CI ordering, new wait | 20 of 20 pass, 10 Chromium and 10 WebKit | | relay-recovery, committed spec, `--repeat-each=10` | 20 of 20 pass, 10 Chromium and 10 WebKit | | solo-legacy-invitation, committed spec, `--repeat-each=10` | 20 of 20 pass, 10 Chromium and 10 WebKit | | solo-legacy-invitation, init script removed | The "dark" pass fails on both engines at the `data-color-mode` assertion: expected "dark", received "light" | | `pnpm typecheck` | passed | | `pnpm lint` | passed, no notes in the touched files | | `biome format` on the two files, `git diff --check` | no changes, clean | - **Forced ordering.** The two forced runs used temporary copies of the spec outside the repository. Each copy had the same two additions: a refused second-community `/query` recorded at the moment of the outage, and a one second pause before the `toBeInViewport` assertion, as on a slower runner. The only difference between the two runs is the wait. - **Init script removed.** This run shows the init script is what sets the mode, and that the `data-color-mode` assertion is live. ## Not proven and not run - **No fail-before run for solo-legacy-invitation.** The CI failure has not been reproduced on macOS WebKit. The 20 passing runs show the journey still works, not that the flake is gone. That proof is the error staying absent from CI. The known rate is low: two occurrences, on 12 and 17 Nov. - **Nothing ran on Linux WebKit.** Hosted CI runs Linux WebKit. Every run above is macOS. CI on this PR is the first Linux run of the change. - **The relay-recovery failure was reproduced by forcing the order.** The unmodified spec did not fail locally without forcing. - **Not run locally.** The rest of the browser suite and the unit tests. - **Pre-push hook.** The branch was pushed with `git push --no-verify`, so the hook did not run. - **Base.** The checks ran on `23d1d7045b`. `main` has since gained one commit, a release CI change (#3665) that touches neither spec. The branch was not rebased. - **Human testing.** No human has tested this, so the review-completed marker is not set. ## Not included, and related PRs - **`find-on-screen.spec.mjs` is deliberately left out.** A third WebKit flake failed in the same run: `window.openFind is not a function`. Commit `c111ae8c6d` "test(search): await find shortcut registration" in open PR #3647 already fixes it by waiting for the hook to be registered. Changing the same lines here would only conflict with it. - **Draft PR #3551 carries an equivalent relay-recovery change.** It sets a flag when a refused `/query` carries a `top_level` filter for the channel. That PR is a 628-file draft that currently conflicts with `main`, so it is not a near-term fix. - **No other open PR was found that fixes either race.** The open PRs were checked by changed file path during the investigation. #2363 and #3551 edit `solo-legacy-invitation.spec.mjs` but leave the boot reload in place. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Matt Toohey <contact@matttoohey.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
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.
Why
Members can lose an enrolled agent's classification when public profile hints disappear. Channel roles also cannot identify an agent who is an admin or owner.
What
Use optional relay-signed agent evidence in Members. Keep known agents in Agents and use neutral Members/Others wording when evidence is missing.
How
Read agent tags from the existing verified roster. Preserve the current owner-read budget, permissions, messaging restrictions, shared rows and avatars. Channel roles alone do not establish agent identity.
Risk
Complete classification requires a supporting relay and a published roster. Older snapshots remain usable; missing evidence does not certify a human identity. The marker supplies no owner attribution or management rights.
Testing
No manual testing. Human acceptance and native validation remain pending. No browser cases were added or removed; existing journeys update group labels, while classification cases stay in the component and protocol tests.
Bigger picture
Client follow-up to block/buzz#8494, which derives ordinary
botroles from recorded ownership. This draft consumes a proposed separateagentroster tag, including for agents with Admin, Owner or Guest roles. The relay companion adds the marker and enrollment refresh. The field is optional, but classification from it requires a supporting relay and a republished roster. The proposed contract needs maintainer agreement before merge.Generated with Codex