Skip to content

Persist the agent workspace on a volume and fix DM tool approval#24

Merged
HiLleywyn merged 2 commits into
mainfrom
claude/extend-archimedes-tools-eS4Xb
May 19, 2026
Merged

Persist the agent workspace on a volume and fix DM tool approval#24
HiLleywyn merged 2 commits into
mainfrom
claude/extend-archimedes-tools-eS4Xb

Conversation

@HiLleywyn

Copy link
Copy Markdown
Owner

Summary

  • Persistent storage. The agent file workspace (the files.* and shell.run tools) now lives at /data/workspace, set via WORKSPACE_ROOT in the Docker image, with the directory created at build time. A volume mounted at /data -- a Railway volume, or a docker run -v mount -- keeps the workspace across redeploys. With nothing mounted, /data is an ordinary directory and the workspace is ephemeral, exactly as before. The /data mount path is documented in railway.toml, .env.example and the README.
  • Bug fix: tool approval silently failed in DMs. _collect_tool_approval resolved the channel with bot.get_channel(), which returns None for an uncached DM channel -- so in a DM every gated tool call was denied without an Approve/Reject prompt ever appearing. The channel is now taken from the placeholder message, which is always the real channel the turn is replying in (guild channel, thread or DM alike).

Deploying on Railway

Attach a volume to the service with the mount path /data. Nothing else is needed -- the image already points WORKSPACE_ROOT at /data/workspace.

Test plan

  • python -m pytest tests/ -- 157 passing.
  • python -m compileall config.py main.py framework ai cogs.
  • Live: in a DM, a gated tool call now shows the Approve/Reject prompt instead of being silently declined.
  • Live: with a volume at /data, files written by files.write survive a redeploy.

Generated by Claude Code

Lleywyn added 2 commits May 19, 2026 09:06
Set WORKSPACE_ROOT to /data/workspace in the image and create the
directory, so a volume mounted at /data -- a Railway volume, or a
docker run -v mount -- keeps the files.* and shell.run workspace
across redeploys. With nothing mounted the path is an ordinary
directory and the workspace is ephemeral, exactly as before. Documents
the /data mount path in railway.toml, .env.example and the README.
_collect_tool_approval resolved the channel with bot.get_channel,
which returns None for an uncached DM channel, so every gated tool
call in a DM was denied without a prompt ever appearing. Take the
channel from the placeholder message instead: it is always the real
channel the turn is replying in, whether a guild channel, a thread or
a DM.
@HiLleywyn HiLleywyn merged commit d6e8be4 into main May 19, 2026
4 checks passed
@HiLleywyn HiLleywyn deleted the claude/extend-archimedes-tools-eS4Xb branch May 19, 2026 09:12
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