Skip to content

feat(runtime): expose active sandbox diagnostics - #1278

Closed
YayoiNanoka wants to merge 1 commit into
apache:mainfrom
YayoiNanoka:feat/runtime-sandbox-diagnostics
Closed

YayoiNanoka wants to merge 1 commit into
apache:mainfrom
YayoiNanoka:feat/runtime-sandbox-diagnostics

Conversation

@YayoiNanoka

Copy link
Copy Markdown
Contributor

Summary

  • add a session-scoped sandbox diagnostics snapshot that reports the effective permission profile, filesystem and network policy, selected backend, selection reason, and typed capability failures
  • wire the same snapshot through Desktop and CLI backend assembly, model turn-tail context, automatic approval review context, and a path-free durable RunTrace projection
  • attach allowlisted structured sandbox failure metadata to command and filesystem tool failure traces without persisting raw error messages or workspace paths

Refs #843

Verification

  • node --test on the focused runtime suites: 239 passed
  • node --test packages/runtime/dist/__tests__/session-manager.test.js: 190 passed
  • npm exec tsc -- -p packages/cli/tsconfig.json --noEmit
  • npm exec tsc -- -p apps/desktop/tsconfig.main.json --noEmit
  • Biome format and lint on all changed files
  • Desktop/CLI end-to-end smoke testing was not run
  • full runtime typecheck is locally blocked by missing @larksuiteoapi/node-sdk and @wecom/aibot-node-sdk installations; no diagnostics-related type errors remain

Security

  • durable RunTrace snapshots omit cwd and workspace roots
  • serialized sandbox failures contain only bounded, allowlisted identifiers and never copy raw error messages

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving. Two things worth a look when convenient:

  • sandbox-context-prompt.ts throws on control chars or paths over 1024 chars, while the sibling sanitizePromptLine replaces them. The same cwd is cleaned gracefully in <env> but can throw here. Align to replace-and-truncate.
  • The RunTraceRecorder => unknown + isPromiseLike branch and the two new index.ts exports (sandboxErrorMetadata, toSandboxRunTraceProjection) have no consumers in this PR. Drop unless an async recorder is actually planned.

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