fix(sharing): bootstrap fresh recipient invitations#1355
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 423c23fbe7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
7cedce9 to
f1c8ef0
Compare
423c23f to
30d140f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 30d140f27b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
f1c8ef0 to
dcbe107
Compare
90d1dab to
f1633f6
Compare
dcbe107 to
a1dac5c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1633f66de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
f1633f6 to
1505cf9
Compare
a1dac5c to
e47597e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1505cf9d12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e47597e to
b8d0b92
Compare
1505cf9 to
4125a92
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4125a9273b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b8d0b92 to
9487e50
Compare
4125a92 to
c4f8345
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4f8345a8e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
c4f8345 to
22e8751
Compare
9487e50 to
9784e3b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22e8751417
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
9784e3b to
be8ae10
Compare
22e8751 to
c1246e3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1246e3c12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
be8ae10 to
0e5c912
Compare
0a92811 to
74b2fec
Compare
0e5c912 to
a0a9a64
Compare
74b2fec to
c74490e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c74490e275
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
489eb35 to
1d1c55c
Compare
c74490e to
374d1eb
Compare
a0a9a64 to
d14a530
Compare
374d1eb to
e325e6c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e325e6c706
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| configuredRecipientActorId && | ||
| configuredRecipientActorId !== addDeviceTargetIdentityId && | ||
| configuredRecipientActorId !== `local:${deviceId}` |
There was a problem hiding this comment.
Respect the environment actor override before adoption
When CODEMEM_ACTOR_ID is set to an established Identity but actor_id is absent from the JSON config, this check treats the profile as bootstrap-safe because it only examines config.actor_id. The add-device invite can therefore be consumed and persisted under its target Identity, but MemoryStore gives CODEMEM_ACTOR_ID precedence on the next start, switching the process back to the old Identity and potentially demoting the newly adopted actor when local actor state is materialized. Resolve the effective actor ID using the same environment precedence as MemoryStore, and reject adoption when that value conflicts with the invite target.
Useful? React with 👍 / 👎.

Description
Fixes
codemem-wosgby making Team-member and add-device invitations carry a canonical, coordinator-owned reviewed-intent snapshot. Fresh recipients can now review and accept invitations without preexisting local Team, Identity, membership, or Project-recipient facts.The snapshot remains digest- and target-bound, invitation URLs remain digest-only, reviewed onboarding is validated before coordinator consumption, add-device Identity adoption is restricted to pristine bootstrap profiles, and local DB/config failures compensate safely. SQLite and D1 coordinator stores share the same fail-closed contract.
Type of Change
Testing
pnpm run tsc,pnpm run lint,pnpm run test)Validation performed:
pnpm run check— 3,310 passed, 3 todopnpm --filter @codemem/cloudflare-coordinator-worker test:worker— Node and Worker runtime suites passedChecklist
pnpm run lintpasses for touched files)