Skip to content

WIP: make tool authoring location rw by default - #4

Closed
Thomas A Caswell (tacaswell) wants to merge 3 commits into
NSLS2:mainfrom
tacaswell:enh/writable_skills
Closed

Thomas A Caswell (tacaswell) wants to merge 3 commits into
NSLS2:mainfrom
tacaswell:enh/writable_skills

Conversation

@tacaswell

Copy link
Copy Markdown
Contributor

Done with 🤖

Summary

Allows tools to author skils/propmts/what-have-you from inside

Description

Increase the number of files we mount into the sandbox rw so that the tools to extend the tools work as expected.

Testing

manual local testing of opencode, not exhaustive of all tools.

Checklist

  • Edit the sections above with relevant information
  • Update in-repo documentation, if applicable
  • Run super-linter locally (or wait for CI) — see .github/workflows/super-linter.yml
  • Test the changes on a representative managed host (or runansible deployment)

@tacaswell

Copy link
Copy Markdown
Contributor Author

Is / will be merged into #25

Thomas A Caswell (tacaswell) added a commit to tacaswell/n2snscripts that referenced this pull request Oct 20, 2026
Personal skills were mounted one entry at a time over a tmpfs, so a new
top-level skill created inside the sandbox was discarded on exit, and the
agents/, commands/ and prompts/ directories the tools also read were not
writable at all (except Copilot's skills/ and agents/).  Tools could
therefore not author their own extensions across sessions.

Replace build_personal_skills_mounts with two helpers in the library,
built on _mount_authoring_dir:

  - build_authoring_dir_mounts KIND DIR...: create DIR on the host (not
    under --dry-run) and bind it read-write as a whole at its logical
    path, so anything created inside the sandbox persists.
  - build_personal_authoring_mounts KIND DIR...: the same, but only for
    directories that already exist (alternate search locations).

Skills symlinked in from a separate repository would dangle in a
whole-directory bind, and bwrap refuses to bind over a symlink inside a
bound directory.  So the resolved target of each symlink entry is also
bound read-write at its own path; only that entry is exposed, not the
repository around it.  Targets, or directories, that resolve into or
contain a blocked location are skipped with a warning.  If the authoring
directory is itself reached through a symlink, fall back to the previous
per-entry binds (new top-level entries are then not persisted).

  - bwopencode, bwopencode2: {skills,agents,commands} under the config
    dir (now skipped by resolve_config_symlinks so the read-only bind
    does not shadow them); ~/.claude/{skills,agents,commands} and
    ~/.agents/{skills,agents} when present
  - bwclaude: {skills,agents,commands} under the Claude home
  - bwcodex: ~/.codex/{skills,prompts}; ~/.agents/skills when present
  - bwcopilot: ~/.copilot/{skills,agents} via the shared helper (replaces
    the inline bind and mkdir); ~/.agents/skills when present

The deployment-managed read-only mounts are unchanged.  Documented in
the launcher headers and a reworked "Authoring directories" section of
docs/bw-wrappers.md.

Based on the approach in NSLS2#4.  Items from that PR
already on this branch (haiku model override, dropped gateway hostname
in bwclaude messages) are not repeated.

Assisted-by: OpenCode:claude-sonnet-5-5
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