Skip to content

fix(core): bound ChatGPT mapping graph traversal - #1916

Merged
phernandez merged 1 commit into
codex-security-literal-directory-prefixfrom
codex-security-chatgpt-graph
Oct 28, 2026
Merged

phernandez merged 1 commit into
codex-security-literal-directory-prefixfrom
codex-security-chatgpt-graph

Conversation

@phernandez

Copy link
Copy Markdown
Member

Why

A cyclic ChatGPT conversation graph keeps expanding children even after its message has been seen. Cycles through message-less nodes hang too. Fixes #1888 (deep-scan K45 / Cloud C35); part of basicmachines-co/basic-memory-cloud#2825.

What Changed

Track visited mapping keys before expanding children. Retain existing message deduplication and conversation order. Add bounded subprocess tests at the real CLI import boundary for self-cycles on the root, a message, and an empty node, plus shared descendants.

Implementation Details

Graph identity is the mapping key used by child references, so traversal uses a separate set from the existing embedded-message identity set. This bounds expansion to the finite input graph without changing ordinary exports or silently abandoning unrelated conversations.

Stacked on #1915; only the ChatGPT traversal and its tests are new in this PR.

Testing

  • Before the fix: three real CLI imports exceeded the 15-second subprocess limit; subprocesses were killed by the test.
  • uv run pytest tests/importers/test_chatgpt_graphs.py tests/cli/test_import_chatgpt.py tests/mcp/tools/test_chatgpt_tools.py -q --no-cov: 33 passed.
  • just fast-check: passed, including type checking.

Risks / Follow-ups

Cloud must update its Core dependency after these fixes land. No production deployment is included. Other import/resource-budget findings remain separate issues.

@phernandez phernandez added the security Security hardening and vulnerability fixes label Oct 28, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-28T18:58:05.484827Z 01e9e6e 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.

@phernandez
phernandez added this pull request to stack #1918 October 28, 2026 19:51
@phernandez
phernandez merged commit 219a762 into main Oct 28, 2026
52 checks passed
@phernandez
phernandez deleted the codex-security-chatgpt-graph branch October 28, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security Security hardening and vulnerability fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminate ChatGPT imports on cyclic mapping graphs

1 participant