Skip to content

fix(image-paste): clear draft attachments on session start - #743

Merged
tt-a1i merged 2 commits into
openpi-dev:mainfrom
outlier27-cell:fix/issue-742-image-session-draft
Oct 14, 2026
Merged

tt-a1i merged 2 commits into
openpi-dev:mainfrom
outlier27-cell:fix/issue-742-image-session-draft

Conversation

@outlier27-cell

Copy link
Copy Markdown
Contributor

Problem

Image-paste draft placeholder mappings lived until session_shutdown, although Pi can begin /new, /resume, and /reload sessions through session_start. A new Session could expand [Image #1] to a previous Session's temporary path.

Closes #742

Value

Clipboard-image draft state is now correctly scoped to one Pi Session.

Approach

  • Clear the image attachment store before each new session installs its editor layer.
  • Add an extension lifecycle regression proving a stale placeholder remains literal after session_start.

Validation

  • node --test --experimental-strip-types tests/extensions/image-paste/index.test.ts (36 passing)
  • bun run check
  • The full suite has known failures in unrelated renderer, Git fixture, and clear-context coverage on this baseline; exact-head GitHub CI is tracked for the final cross-platform result.

Impact

Existing submission, dequeue, and history-recall behavior stays unchanged within a Session. Only stale mappings are discarded at its boundary.

@outlier27-cell

Copy link
Copy Markdown
Contributor Author

@tt-a1i 请审核此 PR。当前精确提交的 GitHub CI 已全部通过,修改范围与回归测试均已在 PR 说明中列明;现仅等待维护者审核。

@outlier27-cell

Copy link
Copy Markdown
Contributor Author

@testikun @tt-a1i 请审核此 PR。最新提交的 CI 已通过,当前仅等待维护者审核与合并。

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed head: 284d48ec2b9a8b20c6e046a50d392879aa2456b1 against main a18f457687b45c877bc8a15d689a7580c4f0659a.

Standards: no confirmed code-level blocker in the scoped change.

Spec: the inspected change matches the stated behavior in this PR. #743 and #688 overlap in Session draft cleanup; retain one integrated behavior and both relevant regressions.

Validation: node --test --experimental-strip-types tests/extensions/image-paste/index.test.ts: exit=0; ℹ tests 36; ℹ pass 36; ℹ fail 0; ℹ skipped 0

The unchanged-head focused receipts are reused after a live head/main refresh; #718 uses this round's latest-head tests. This code review does not claim installed-runtime, live-provider, full merged-queue or visual acceptance. No merge is authorized by this review.

@tt-a1i
tt-a1i merged commit 26a0611 into openpi-dev:main Oct 14, 2026
18 checks passed
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.

bug(image-paste): clear draft attachments on new sessions

2 participants