Skip to content

sbx: document overriding agent settings from a kit#25160

Open
dvdksn wants to merge 1 commit into
docker:mainfrom
dvdksn:sbx-kits-agent-settings
Open

sbx: document overriding agent settings from a kit#25160
dvdksn wants to merge 1 commit into
docker:mainfrom
dvdksn:sbx-kits-agent-settings

Conversation

@dvdksn
Copy link
Copy Markdown
Contributor

@dvdksn dvdksn commented May 25, 2026

Summary

Static files and initFiles can't override paths the active agent writes during its own setup (such as /home/agent/.claude/settings.json), because the agent's setup runs after kit injection. This surfaced from user feedback on the kits page.

  • kits.md (Inject files): short conceptual note that workspace files work as static files, but user-scope paths under /home/agent/ get overwritten, with a pointer to the example.
  • kit-examples.md: new "Override agent settings" section with a commands.startup workaround using a heredoc.

Generated by Claude Code

@netlify
Copy link
Copy Markdown

netlify Bot commented May 25, 2026

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 1bdda1a
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/6a1467098772160008deb868
😎 Deploy Preview https://deploy-preview-25160--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@dvdksn dvdksn added the status/review Pull requests that are ready for review label May 25, 2026
Copy link
Copy Markdown

@docker-agent docker-agent left a comment

Choose a reason for hiding this comment

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

Assessment: 🟡 NEEDS ATTENTION

Two medium-severity issues found in the new content — both on the same closing sentence of the new kit-examples.md section. The overall approach (using commands.startup with a heredoc) is sound and the docs are clear. No redirects needed (new content only).

```

Startup commands replay on every sandbox start, so the script must be
idempotent. The `cat > … <<EOF` pattern above overwrites cleanly each
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MEDIUM] Word "above" used — style guide requires "previous"

The prose says "The cat > … <<EOF pattern above overwrites cleanly each time." The STYLE.md word list explicitly maps aboveprevious. Change to: "The cat > … <<EOF pattern previously shown overwrites cleanly each time." (or rewrite to avoid the reference entirely).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reworded to "the heredoc pattern" — sidesteps both the aboveprevious style rule and the <<EOF vs <<'JSON' mismatch. Added heredoc to the Vale vocabulary.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perfect — "the heredoc pattern" is clearer than either the original reference or my suggestion. It names the technique directly instead of pointing backward, and it neatly avoids the <<EOF vs <<'JSON' mismatch I didn't catch. Thanks for the vocabulary addition too!

```

Startup commands replay on every sandbox start, so the script must be
idempotent. The `cat > … <<EOF` pattern above overwrites cleanly each
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MEDIUM] Prose says <<EOF but the code uses <<'JSON' — misleading description

The explanation reads "The cat > … <<EOF pattern…", but the YAML example above it uses <<'JSON' as the heredoc delimiter (with a quoted delimiter to prevent variable expansion). Calling it <<EOF doesn't match the actual code and could confuse readers who look at the example and see JSON, not EOF. Suggest: "The cat > … <<'JSON' heredoc pattern…" or simply "This heredoc pattern…".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reworded to "the heredoc pattern" — sidesteps both the aboveprevious style rule and the <<EOF vs <<'JSON' mismatch. Added heredoc to the Vale vocabulary.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perfect fix! Using "the heredoc pattern" is clearer and avoids both the delimiter mismatch and the directional reference. Thanks for the quick turnaround and for adding heredoc to Vale's vocabulary — that'll help keep the terminology consistent across the docs.

Sandboxes write settings files for some built-in agents (such as
/home/agent/.claude/settings.json for the claude agent) via a PostStart
hook in vm_configurator.go, which fires after kit static files and
initFiles. Document the overwrite behavior in kits.md and add a worked
commands.startup example in kit-examples.md.
@dvdksn dvdksn force-pushed the sbx-kits-agent-settings branch from bd0abfd to 1bdda1a Compare May 25, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ai area/tests status/review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants