Skip to content

fix(social): Codex review follow-up for #141 (canonical grants, inbound backfill, scoped unhide) - #142

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
Birfy:cursor/selftest-141-codex-review
Oct 16, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
Birfy:cursor/selftest-141-codex-review

Conversation

@Birfy

@Birfy Birfy commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to the already-merged #141. Addresses all Codex review findings on that PR before they ship further.

P1

  • Canonical grantee: list_bot_grants decorated values like Chief@chief.bob.home are stored as @chief.bob.home in core grants (normalizeGrant + syncOutgoingGrants), so normGrantee / reach can match.
  • Respond Auto-send: social/respond resolves the peer home from the pending request (or result / newly added bots for that relationship), not the first nonempty roster home.
  • Inbound backfill: one-time inboundBackfilled seeds inboundBots from the current list_remote_bots roster before the outgoing-only filter, so upgrade does not permanently drop reciprocal friends.

P2

  • markRoomRemote: skips handles already inbound or present in the friend roster.
  • relationship_exists unhide: scopes reveal to the invite's Bot/peer home (peer/bot carried on the mapped error); unrelated hidden remotes stay hidden.
  • nextOnboardDisplayName: truncates so the numeric suffix still changes the handle within homeHandleOf's 32-char sanitized limit.

Test plan

  • ARCH_DOCS_BASE=upstream/main npm run verify (local)
  • CI green on this PR

…ound backfill, scoped unhide

- Persist canonical @Handles in core grants (not decorated Chief@…).
- Seed inboundBots once from the existing remote roster so upgrade does not
  drop reciprocal friends before the outgoing-only filter.
- Resolve Auto-send on respond from the pending relationship, not the first
  roster home.
- Scope relationship_exists unhide to the invite's Bot/peer home.
- Do not mark existing friend remotes as room-only; truncate onboard
  suffixes within the 32-char homeHandleOf limit.

Co-authored-by: Danyang Chen <birfychen@gmail.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T12:34:19.226417Z dfda61a PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Birfy
Birfy added this pull request to the merge queue Oct 16, 2026
Merged via the queue into ThinkFlowLab:main with commit c83feff Oct 16, 2026
6 checks passed
@Birfy
Birfy deleted the cursor/selftest-141-codex-review branch October 16, 2026 12:31

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dfda61a3cf

ℹ️ 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".

const homes = mapRemoteHomes(result?.homes)
const next = revealHiddenIfPresent(settings, presentRemoteHandles(homes))
// Scope unhide to the invite's Bot/peer home — never every remote on the home.
const focus = norm(mapped.bot?.handle || mapped.peer?.handle)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Carry structured MCP error fields into the unhide path

When join_invite returns a normal MCP isError payload, createMcpClient rebuilds it at plugins/social/src/mcp-client.js:137 as a BotSocialError containing only message and code, so both mapped.bot and mapped.peer are absent here. Consequently focus and handles stay empty and reusing an invite can no longer unhide the requested Bot; the new test misses this because its mock throws the enriched JavaScript error before MCP serialization. Preserve the structured error fields when wrapping the response, or resolve the relationship through another call.

Useful? React with 👍 / 👎.

})()
if (settings.inboundBots?.[key] || settings.inboundBots?.[peerHome]) return
// Already a normal friend in the roster — do not reclassify as room-only.
if (listedRemoteBots().some(bot => bot.handle === key || bot.home === key || bot.home === peerHome)) return

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Track room-only siblings independently

When a face room contains @writer.bob.home while @coder.bob.home is already a normal friend, listedRemoteBots() contains an entry whose home is @bob.home, so this same-home check suppresses Writer's room-only marker even though Writer itself was never granted. After leaving, dropRoomRemotes has no record for Writer, allowing the server-leak path that roomBots is designed to filter to leave that sibling in Friends' Bots; only an exact member match (or an explicitly home-level identity) should count as already listed.

AGENTS.md reference: AGENTS.md:L59-L59

Useful? React with 👍 / 👎.

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.

2 participants