Skip to content

fix(agent): stage sandbox attachments and expose file tools - #2856

Open
nullptr-error wants to merge 2 commits into
Tencent:mainfrom
nullptr-error:fix/sandbox-attachment-staging-and-shell-tools
Open

fix(agent): stage sandbox attachments and expose file tools#2856
nullptr-error wants to merge 2 commits into
Tencent:mainfrom
nullptr-error:fix/sandbox-attachment-staging-and-shell-tools

Conversation

@nullptr-error

Copy link
Copy Markdown
Collaborator

Summary

  • Restores chat attachments into sandbox sessions by resolving persisted temporary-document storage refs before staging.
  • Decouples sandbox file inspection tools from installed skills so agents can inspect staged inputs even when skills are disabled.
  • Keeps shell access tied to the explicit skills switch while allowing fresh skill-enabled sandboxes to receive shell_exec before skills are installed.

Test plan

  • go test ./internal/application/service -run 'Test(StageSessionAttachments|BuildSandboxAttachmentsPrompt|CreateAgentEngine)'
  • go test ./internal/application/service currently fails locally in TestSkillPythonVerifier/a_pyproject.toml_dependency_the_venv_does_not_carry; this appears unrelated to this branch because the focused tests for the changed areas pass.

hailongzhao added 2 commits August 28, 2026 17:01
…rom the temporary document

MessageAttachment.URL is json:"-" so it never survives DB serialization,
but stageSessionAttachments depended on it to read the source file, which
silently dropped every attachment before it could be written into
/workspace/input.

Resolve the storage handle from the temporary_documents row keyed by
attachment.ID (GetScoped) when the URL is missing, and pass the session
tenant through staging so shared-agent sessions look up the right row.
shell_exec was gated on "skills enabled AND a ready skill exists", so an
agent whose skills were still installing (or had none) never received a
shell. Since shell_exec can execute skill scripts, it now follows the
SkillsEnabled switch alone.

list_sandbox_files / read_sandbox_file are pure filesystem capabilities
and no longer follow SkillsEnabled at all: they are registered whenever
the sandbox advertises a SessionFileStore, including for the installer.
Copilot AI lite review requested due to automatic review settings August 28, 2026 09:33

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants