Skip to content

fix: preserve exact IDs in AdvancedSQLiteSession.delete_branch - #4980

Draft
JiangLLM wants to merge 1 commit into
openai:mainfrom
JiangLLM:fix/preserve-exact-session-branch-id
Draft

fix: preserve exact IDs in AdvancedSQLiteSession.delete_branch#4980
JiangLLM wants to merge 1 commit into
openai:mainfrom
JiangLLM:fix/preserve-exact-session-branch-id

Conversation

@JiangLLM

Copy link
Copy Markdown

This pull request fixes incorrect branch deletion in AdvancedSQLiteSession.

Summary

The API treats "draft" and " draft " as distinct branch IDs. However, delete_branch() removes spaces at both ends of the ID. As a result, a request to delete " draft " can delete "draft" instead.

This fix preserves the exact ID after the blank-input check. It also adds tests that verify the requested branch is removed and the other histories remain intact.

Test plan

  • Both new regression cases fail before the fix. All 131 tests in the affected file pass after it.
  • Format, lint, mypy, and pyright checks pass. Two independent code reviews found no blockers.
  • The full verification script reports 9,574 tests passed, 56 skipped, and 11 failed. All 11 failures occur because the sandbox blocks local test servers from opening ports. Serial tests were not reached, so full verification remains incomplete.

Issue number

None.

Checks

  • I've added new tests, if relevant
  • I've run .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed all verification steps pass
  • If using Codex, I've run /review before submitting this PR

AI tools assisted with the analysis, code, tests, and review. The /review command itself has not been run.

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