Skip to content

fix(memory): reject reused branch IDs when creating a branch - #4186

Merged
seratch merged 3 commits into
mainfrom
fix/advanced-sqlite-branch-id-collision
Aug 5, 2026
Merged

fix(memory): reject reused branch IDs when creating a branch#4186
seratch merged 3 commits into
mainfrom
fix/advanced-sqlite-branch-id-collision

Conversation

@seratch

@seratch seratch commented Aug 5, 2026

Copy link
Copy Markdown
Member

This pull request fixes branch ID reuse in AdvancedSQLiteSession, which could silently append messages to an existing populated branch.

It takes over and supersedes #4152, preserving the original contribution and crediting Henry Su via the commit's Co-authored-by trailer.

Generated branch IDs now receive a numeric suffix when a collision occurs, while explicitly reused populated branch IDs raise ValueError before any session state is modified.

This pull request resolves #4150.

Co-authored-by: Henry Su <henrysu4707@gmail.com>

@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: cf322479e1

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

Comment thread src/agents/extensions/memory/advanced_sqlite_session.py Outdated

@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: 290b2de6ac

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

Comment thread src/agents/extensions/memory/advanced_sqlite_session.py Outdated
Co-authored-by: Henry Su <henrysu4707@gmail.com>
@seratch
seratch merged commit 7379e75 into main Aug 5, 2026
9 checks passed
@seratch
seratch deleted the fix/advanced-sqlite-branch-id-collision branch August 5, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AdvancedSQLiteSession.create_branch_from_turn silently merges into an existing branch

1 participant