Skip to content

feat: add explicit Claude session_id resume to avoid heartbeat thread…#2036

Open
LogicOber wants to merge 1 commit intolanggenius:mainfrom
LogicOber:bump/better-e2b-sandbox-session-id
Open

feat: add explicit Claude session_id resume to avoid heartbeat thread…#2036
LogicOber wants to merge 1 commit intolanggenius:mainfrom
LogicOber:bump/better-e2b-sandbox-session-id

Conversation

@LogicOber
Copy link
Collaborator

@LogicOber LogicOber commented Feb 7, 2026

Plugin Submission Form

1. Metadata

  • Plugin Author: lysonober
  • Plugin Name: Better E2B Sandbox
  • Repository URL: https://github.com/LogicOber/dify-plugins/tree/bump/better-e2b-sandbox-session-id/LogicOber/better-e2b-sandbox

2. Submission Type

  • New plugin submission
  • Version update for existing plugin

3. Description

This update fixes an important Claude Code conversation continuity issue when using Setup Sandbox Heartbeat alongside multi-turn Send Sandbox Input conversations.

Problem
Users often run multi-turn Claude Code chats via Send Sandbox Input with claude --continue. When a Heartbeat task is created in the middle, Heartbeat runs in a separate session (claude -p), but Claude Code still records it as the “most recent” session. On the next user interaction, claude --continue may resume the Heartbeat session instead of the user’s main conversation thread, causing context loss / thread hijack.

Solution: explicit Session ID mechanism
Send Sandbox Input now supports:

  • capture_session_id (bool, default false): when enabled, the tool captures the current Claude Code session_id after execution and returns it in JSON output.
  • session_id (string, optional): when provided, the tool uses claude --resume <id> -p to resume the exact intended conversation thread.

Command priority:

  1. if session_id is provided → use --resume <id>
  2. else if resume_session=true → use --continue
  3. else → start a fresh session (-p)

This lets Dify workflows store and reuse the correct session_id for the main conversation, while Heartbeat can remain isolated without interfering.

Additional changes in this update

  • Send Sandbox Input now supports multiple file uploads via attachments (type: files). The tool writes each file to /home/user/uploads/ and appends all uploaded paths to the end of input_text. Output is updated from uploaded_path to uploaded_paths.
  • Write Sandbox File now supports batch upload via upload_files (type: files). When upload_files is provided, files are written to the target directory using their original filenames and content is ignored. content is now optional (either content or upload_files must be provided).

4. Checklist

  • I have read and followed the Publish to Dify Marketplace guidelines
  • I have read and comply with the Plugin Developer Agreement
  • I confirm my plugin works properly on both Dify Community Edition and Cloud Version
  • I confirm my plugin has been thoroughly tested for completeness and functionality
  • My plugin brings new value to Dify

5. Documentation Checklist

  • Step-by-step setup instructions
  • Detailed usage instructions
  • All required APIs and credentials are clearly listed
  • Connection requirements and configuration details
  • Link to the repository for the plugin source code

6. Privacy Protection Information

Data Collection

No new user personal data collection is introduced in this update. This change only adds optional workflow parameters to control Claude Code session resuming behavior.

Privacy Policy

  • I confirm that I have prepared and included a privacy policy in the plugin package based on the Plugin Privacy Protection Guidelines

@LogicOber LogicOber force-pushed the bump/better-e2b-sandbox-session-id branch from 7381a29 to 3894fda Compare February 7, 2026 11:08
@LogicOber LogicOber force-pushed the bump/better-e2b-sandbox-session-id branch from 3894fda to 28730f0 Compare February 7, 2026 11:18
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