Skip to content

fix: Paginate through all organization members in domain user backfill#826

Merged
bokelley merged 1 commit into
mainfrom
bokelley/fix-auto-add-domain
Jan 20, 2026
Merged

fix: Paginate through all organization members in domain user backfill#826
bokelley merged 1 commit into
mainfrom
bokelley/fix-auto-add-domain

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Fixed auto-add domain users feature to paginate through all WorkOS organization members
  • Previously only checked first page (max 100 members), causing users to incorrectly appear as "available to add" when they were already members

Test plan

  • TypeScript compiles without errors
  • All existing tests pass
  • Verified admin-domain-health page loads correctly in dev mode
  • Test in production with organization that has 100+ members - "55 users" count should drop to actual non-members

🤖 Generated with Claude Code

The auto-add domain users feature was only checking the first page of
organization memberships from WorkOS (max 100). Organizations with more
members would incorrectly show users as "available to add" when they
were already members.

Fixed by adding pagination loops that fetch all membership pages using
listMetadata.after cursor, matching the pattern used elsewhere in the
codebase.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit 99f7f60 into main Jan 20, 2026
6 checks passed
bokelley added a commit that referenced this pull request Apr 24, 2026
…#2889) (#2992)

* feat(training-agent): dogfood @adcp/client 5.14 seller helpers (closes #2889)

Adopts the five helper families shipped for seller authors in
`@adcp/client` 5.11–5.14:

- `wrapEnvelope` for sibling-field emission in the framework server's
  response adapters
- `bridgeFromSessionStore` wires `comply_test_controller.seed_product`
  fixtures through `get_products` on sandbox requests (new behavior —
  closes a latent gap where seeded products never reached the buyer
  tool)
- `mergeSeedProduct` replaces the shallow-spread overlay in
  `overlaySeededProducts`
- `mcpAcceptHeaderMiddleware` replaces the inline Accept header +
  rawHeaders rewrite on `/mcp` and `/mcp-strict`
- `adcpError()` + dispatcher `sanitizeAdcpErrorEnvelope` make
  `conflict-envelope.ts` and the response-body wrapper redundant —
  both deleted; a framework-path regression locks in that `recovery`
  is stripped from `IDEMPOTENCY_CONFLICT` envelopes at both transport
  layers

Follow-ups filed as adcontextprotocol/adcp-client#824, #825, #826,
#827 landed in 5.14 (closed), so the adoption is complete rather than
partial. Deferred: migrating `comply_test_controller` off the
`customTools` path to `registerTestController` for its auto-emitted
capability block.

Net `+183 / -459` — 276 lines of bespoke glue removed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* revert: pin @adcp/client to 5.13.0, trim adoption to 5.13-safe helpers

@adcp/client 5.14 regressed the storyboard runner — with 5.14 the
training agent drops from 52/52 clean to 39/52 (confirmed against both
this branch and main, identical behavior). Filed upstream as
adcontextprotocol/adcp-client#866.

For this PR, pin to 5.13.0 and narrow the adoption to what works
there: `wrapEnvelope`, `mergeSeedProduct`, and a hand-rolled session-
scoped `testController.getSeededProducts` callback (new behavior —
seeded products now flow through `get_products`, closing a latent
gap).

Put back until the 5.14 bump resolves adcp-client#866:

- inline Accept-header + rawHeaders rewrite on `/mcp` and `/mcp-strict`
- `conflict-envelope.ts` + `wrapResponseForConflictRedaction`
- response-wrapper regression test file

Drop the framework-path regression test for `recovery`-absence on
`IDEMPOTENCY_CONFLICT` — that path exists now only at the HTTP-layer
redactor, which `dispatchTestRequest` doesn't exercise. The legacy
`conflict-envelope.test.ts` covers the redactor's unit contract.

Storyboards local verify:
- legacy (TRAINING_AGENT_USE_FRAMEWORK=0): 52/52 clean, 380 passed, 0 failed
- framework (=1): 51/52 clean, 390 passed, 1 known residual

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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