The development workspace
A persistent project folder on this machine or over SSH, projects with names, and where Docker fits when you want to run an app.
You ask Developer to install Discourse’s dependencies and start it. The next day you open a fresh chat on the same project. The installed files are still there, and if the app’s service stayed up, it can still answer. The development workspaceA project folder that Developer’s tools can return to across chats, on the Pipal host or under an account reached over SSH. gives the assistant a place to do that kind of work.
In this chapter
- Locate the chat, checkout, and running app in a development setup.
- Follow the first Send that opens the project folder.
- Follow a command through the shared runner and see what stops when the call ends.
- Tell what survives a new chat, a Pipal restart, and a machine reboot.
Two locations can keep a checkout across chats
The development workspace has two choices for the locationThe place a chat uses for project tools, either the Pipal host, an account reached over SSH, or a Docker project. of your project. This machine runs Developer’s tools on the Pipal host. SSH machine runs them through a separate login, which can be on the same host or another machine. development-workspace.ts
- One setup, two machines
In the maintainer’s setup, the Linux machine runs in OrbStack on the same Mac. A separate Linux server can fill the same role.
- Pipal host
- Pipal server
Keeps the chat, checks tool grants and starts a separate SSH client for each remote request.
- Chat database
A new project chat records the location, project name and scope in
durable.sqlite. - SSH client
Runs on the Pipal host and connects as the development user. Its input stream stays open while the tool works.
- Pipal server
- Linux machine
- Development account
Runs the tools with its own permissions and uses the network available on this machine. The account’s filesystem permissions set the boundary for Bash.
- Node.js runner
Receives its source in the SSH command. It checks the project and starts Bash or the file helper.
- Project folder
Holds the files later calls and new chats can open. Bash starts here by default.
- Node.js runner
- Docker engine · Optional
When a Bash command starts an app under Docker, the engine manages the app container independently of the tool call.
- Development account
- Pipal host
- Pipal server → Chat database · Stores the project binding and published file copies
- Pipal server → SSH client · Starts the client
- SSH client → Node.js runner · Starts remote Node.js and sends the request
- Node.js runner → Project folder · Checks the folder before starting the command
- Docker engine → Project folder · Can mount source files into an app
Project folder
Holds the files later calls and new chats can open. Bash starts here by default.
Talks to
In the maintainer’s own setup, Pipal runs on a Mac from ~/projects/pipal, and OrbStack runs a small Linux machine, pipal-dev-check, on that same Mac. Pipal keeps the chat in durable.sqlite on its host. This is an SSH machine setup. The development accountThe operating system user whose permissions and network access the development workspace tools use. runs commands and file operations on the Linux machine, which can also be a separate server. index.ts development-workspace.ts
The reason to set this up is the work between calls. If a build needs packages from a registry, Bash can reach it when the machine running it has network access to the registry. A dependency installed in the checkout or the account’s home stays where the command put it. The design decision describes an acceptance scenario. Set up Discourse and migrate its database in one chat, then use a second chat on the same project to verify the app and check that it responds again after a service restart. development-workspace.ts adr-development-workspace.md
| Feature | This machine | SSH machine |
|---|---|---|
| Who runs Bash? | The unprivileged Pipal service user on Linux or macOS. | The configured, separate login on Linux. |
| Where are the files and containers? | Project files are under the Pipal data directory. Any app containers live on the Docker engine the service account uses. | Project files are on the SSH machine. Any app containers live on the Docker engine the development account uses. |
| What can an approved command reach? | Files the service account can access, including durable.sqlite and the saved model login. | Files the development account can access, including its other projects. |
| What does the operator maintain? | A writable data directory and project tools on the host, including Docker if the app uses it. | A writable project directory and project tools, plus the SSH login, client key and verified host key. |
Choose up to two columns
| Feature | This machine | SSH machine |
|---|---|---|
| Who runs Bash? | The unprivileged Pipal service user on Linux or macOS. | The configured, separate login on Linux. |
| Where are the files and containers? | Project files are under the Pipal data directory. Any app containers live on the Docker engine the service account uses. | Project files are on the SSH machine. Any app containers live on the Docker engine the development account uses. |
| What can an approved command reach? | Files the service account can access, including durable.sqlite and the saved model login. | Files the development account can access, including its other projects. |
| What does the operator maintain? | A writable data directory and project tools on the host, including Docker if the app uses it. | A writable project directory and project tools, plus the SSH login, client key and verified host key. |
Put Bash and Node.js on the Linux machine and give Pipal’s service account a dedicated SSH key for the login. The corresponding public key goes in the development account’s authorized_keys. In Pipal’s config.toml, host names the destination and user names the Linux account. The optional ssh_config points to a file on the Pipal host that can specify which key and known-hosts file to use. deployment.md config.ts
# [extensions.development_workspace]# host = "development"# user = "pipal-dev"# ssh_config = "./development.ssh"# projects_root = "/home/pipal-dev/projects"# The first chat suggests pipal-scratch. Users can enter their own folder name.The example ships commented out. To use this layout, add the stanza and point it at an existing Linux project root and your local SSH configuration. If you omit user, Pipal uses pipal-dev. With a custom extensions.enabled list, include pipal.coding or pipal.bash to make the location available. Restart Pipal to load the configuration, then enable SSH machine in Settings → Workspace and choose Save changes if it is off. Deploying Pipal covers provisioning. config.ts DeveloperWorkspace.svelte
A fresh installation starts with all locations off. If durable.sqlite exists and there are no saved workspace settings, loadWorkspaceLocations() imports a configured SSH or Docker location with a project tool grant. Three ways to touch a project covers workspace settings. workspace-locations.ts
The first Send opens a real directory
- This machine
<data dir>/projects/- Suggested project
pipal-scratch/With the default data directory, this isdata/projects/pipal-scratch/on the Pipal host.
- SSH machine with projects_root
/srv/projects/- Suggested project
pipal-scratch/The first Send can create this folder directly underprojects_root. - Another project
Demo app/Spaces are allowed inside a project name. Pipal discovers validly named, real direct subdirectories when it opens the location.
- Maintainer’s named project “source”
/home/pipal-build/source/- The Discourse checkout
discourse/In the maintainer’s setup,discourse_devmounts this folder at/src. - Scripts to start and stop Discourse
discourse-dev/ - New names go here
.pipal-projects/- Suggested project
pipal-scratch/With named bindings alone, a new name goes inside.pipal-projectsunder the first named directory.
- This machine
- Suggested projectWith the default data directory, this is
data/projects/pipal-scratch/on the Pipal host.
- SSH machine with projects_root
- Suggested projectThe first Send can create this folder directly under
projects_root. - Another projectSpaces are allowed inside a project name. Pipal discovers validly named, real direct subdirectories when it opens the location.
- Maintainer’s named project “source”
- The Discourse checkoutIn the maintainer’s setup,
discourse_devmounts this folder at/src. - Scripts to start and stop Discourse
discourse-dev/ - New names go here
- Suggested projectWith named bindings alone, a new name goes inside
.pipal-projectsunder the first named directory.
This machine puts projects under projects/ in Pipal’s data directory. For SSH machine, use projects_root to discover validly named, real directories directly under a parent and put new projects there. You can also configure projects, a table that maps names to existing directories, with or without projects_root. With named entries alone, Pipal lists and opens chat-named projects under .pipal-projects inside the first configured directory. The first new name creates that parent if needed. workspace-locations.ts development-workspace.ts
In a new Developer chat on This machine or SSH machine, open Runtime. Choose the Location if there is a choice, then type a name in Project or pick one of its suggestions. The browser remembers projects by location and suggests pipal-scratch when it has no remembered project to use. Your first Send opens or creates the folder and saves the location and project with the chat. To switch either one, start a new chat. RuntimePicker.svelte workspace-choice.ts
Deep diveHow the first Send opens the directory outside the chat transaction
- Composer
- Hono app.ts
- Core
- SQLite
- Host backend development-workspace.ts
- Remote runner
Composer → Composer · Name project
Choose a location and name in the draft
The location and project belong to the draft. Here the location is SSH machine.
Composer → Hono · Create chat
Send starts with a request to create the chat
The browser posts to
/api/v1/conversationswithlocation,projectand a request ID it can reuse if the reply is lost.Hono → Core · Call create()
Hono calls Core in the host process
The route validates the body and passes the chat settings and request ID to the runtime.
Core → SQLite · First commit
Core checks the receipt and the location
For a new chat it saves the request signature and selected location when a request ID is supplied. The transaction returns the name to open.
Core → Host backend · openProject()
Core calls the host’s project opener
The call happens outside the SQLite transaction. The host backend handles the selected location.
Host backend → Remote runner · Open over SSH
The host backend starts SSH and sends the request
For this new name the runner creates the directory with mode
0700or reuses an existing canonical directory. A file or symlink with that name blocks the request.Remote runner → Host backend · Return identity
The runner reports the directory and its identity
The host derives the project’s scope and makes the binding available by name.
Host backend → Core · Project opened
The opener returns to Core
Core can now look up the binding in the backend’s project catalog.
Core → SQLite · Second commit
Core creates the chat with the binding
It rechecks the receipt and backend, saves the location, project name and scope, and records the chat ID for retries.
Core → Hono · Chat snapshot
Core returns the saved chat
The snapshot contains the chat’s ID, location and project.
Hono → Composer · 201 Created
The composer can address the new chat
Hono sends the snapshot. The browser can remember the project for that location.
Composer → Hono · Post message
The composer posts the first message for that chat ID
The chat ID goes in
/api/v1/conversations/:id/messages.Hono → Core · Call submit()
Hono hands the message to Core
Core admits the input. Tool calls in the reply can now use the saved project binding.
Composer → Composer
Choose a location and name in the draft
The location and project belong to the draft. Here the location is SSH machine.
The browser’s send() posts first to Hono’s POST /api/v1/conversations route. Both the route and the host’s project opener run in the Pipal process with Core. App.svelte app.ts
When opening a location, persistentTools() inspects any named directories, then lists projects under the chosen parent. It keeps explicit bindings when a discovered name or directory matches one already in the catalog. The SSH config requires distinct named paths and absolute, normalized Linux paths. The runner further requires a directory path to equal its real path. Pipal resolves ssh_config on its host relative to config.toml. config.ts development-workspace.ts development-runner.mjs
In create(), even a project already in the catalog goes through openProject() outside the SQLite transaction. The opener inspects configured paths again and opens other names under the project parent. Core checks that the same backend is still open before saving location, project and projectScope in pipal.chat. When a request ID is supplied, both passes use the same creation receipt. A retry with the same input reuses the saved chat ID, and different input returns a conflict. The opt-in integration test checks that concurrent creates with one request ID return one chat ID and leave one binding for the name. index.ts development-workspace.ts development-workspace.test.ts
Both locations use the same Bash runner
- Pipal
- Runner
- Bash
Pipal → Pipal · Resolve project
The approved call looks up its location and binding
Core checks the scope at the pinned location. The host routes the call there and resolves the scope to a directory and identity.
Pipal → Runner · Start SSH
SSH starts Node.js on Linux
The remote command contains the runner’s source code.
Pipal → Runner · Send JSON
The request arrives as one line
It carries the operation, expected user, project directory and identity, command, optional working directory, and timeout in seconds. The input stream remains open.
Runner → Runner · Check identity
Check the account, project and starting path
The runner checks the account and machine ID, compares the directory identity, resolves and checks the starting path, then checks that stdin is still open.
Runner → Bash · Start Bash
Bash starts in the project
Bash starts in the checked directory with
--noprofile --norc -cand its own process group. Its standard input is ignored.Bash → Pipal · Stream output
SSH carries command output back to Pipal
Bash inherits the runner’s standard output and standard error. The host forwards both streams to the tool output as the command runs.
Bash → Runner · Process exit
The runner gets the exit status
The runner uses Bash’s exit code, or 1 if there is no code. If the runner’s timer expires, it kills the group, then prints a timeout message and sets its own exit code to 124 when the child exits.
Runner → Bash · Kill group
The runner cleans up the command group
Any children still in the group are stopped. A service Docker owns has its own lifecycle.
Runner → Pipal · Exit status
The tool records the exit code
For a completed call, Pipal shows the code as a diagnostic and treats a nonzero code as an error. Over SSH, 254 and 255 trigger extra checks.
Pipal → Pipal
The approved call looks up its location and binding
Core checks the scope at the pinned location. The host routes the call there and resolves the scope to a directory and identity.
When Developer asks to run a command, the approval gate comes first. For SSH machine, Pipal starts an SSH client that sends the runner program to Node.js on Linux. For This machine, Pipal starts the same runner directly with its own Node executable. In both locations, the runner checks the selected directory and starts Bash there by default. The command’s output comes back into the chat as it runs, and the tool reports the exit code at the end of a completed command. development-workspace.ts development-runner.mjs
The file tools also work in the selected folder. Pi’s read, edit, and write ask Pipal to run the same file helper used by the Docker project. Here that helper runs under the account that runs Bash. An edit lands in the project’s checkout, so the next command sees it there. development-workspace.ts development-runner.mjs
With pipal.coding in either location, ask Developer to attach a saved project file. publish_file reads it through the same helper after approval or with matching YOLO. For an SSH project the bytes come back over SSH. The copy lives with the chat on the Pipal host, where you can download it. development-workspace.ts web-artifacts.ts
An enabled SSH machine stays selected if its startup connection fails or a tool call detects a dropped link. Settings shows Unavailable with the reason. Once the machine is reachable, use Retry connection in Settings → Workspace to reopen it without restarting Pipal. Existing chats regain tool access if their saved project binding still matches. workspace-locations.ts DeveloperWorkspace.svelte
- Pipal
- Runner
- Bash
Pipal → Pipal · Resolve project
The approved call looks up its location and binding
Core checks the scope at the pinned location. The host routes the call there and resolves the scope to a directory and identity.
Pipal → Runner · Spawn Node.js
Pipal starts Node.js on its own host
Pipal starts the runner as the service user using its own Node executable.
Pipal → Runner · Send JSON
The request arrives as one line
It carries the operation, expected user, project directory and identity, command, optional working directory, and timeout in seconds. The input stream remains open.
Runner → Runner · Check identity
Check the account, project and starting path
The runner checks the account and machine ID, compares the directory identity, resolves and checks the starting path, then checks that stdin is still open.
Runner → Bash · Start Bash
Bash starts in the project
Bash starts in the checked directory with
--noprofile --norc -cand its own process group. Its standard input is ignored.Bash → Pipal · Stream output
Local pipes carry command output back to Pipal
Bash inherits the runner’s standard output and standard error. The host forwards both streams to the tool output as the command runs.
Bash → Runner · Process exit
The runner gets the exit status
The runner uses Bash’s exit code, or 1 if there is no code. If the runner’s timer expires, it kills the group, then prints a timeout message and sets its own exit code to 124 when the child exits.
Runner → Bash · Kill group
The runner cleans up the command group
Any children still in the group are stopped. A service Docker owns has its own lifecycle.
Runner → Pipal · Exit status
The tool records the exit code
For a completed call, Pipal shows the code as a diagnostic and treats a nonzero code as an error. Over SSH, 254 and 255 trigger extra checks.
Pipal → Pipal
The approved call looks up its location and binding
Core checks the scope at the pinned location. The host routes the call there and resolves the scope to a directory and identity.
Deep diveWhat Pipal passes to SSH and what the runner checks
['-T', '-oBatchMode=yes',
'-oStrictHostKeyChecking=yes',
'-oClearAllForwardings=yes',
'-oForwardAgent=no',
'-oForwardX11=no',
'-oConnectTimeout=8',
'-oServerAliveInterval=10',
'-oServerAliveCountMax=3',
...(config.ssh_config ?
['-F', config.ssh_config] : []),
'-l', config.user,
'--', config.host,
"exec node --input-type=module -e '" +
runner.replaceAll("'", "'\\''") + "'"] - Run without a terminal or prompts
-Tdisables terminal allocation. Batch mode makes authentication fail instead of prompting in a tool call. - Require a verified host key
SSH requires a trusted host key and refuses an unknown or changed key instead of accepting it during the tool call.
- Keep the connection for the tool
SSH clears port forwards and disables forwarding of the host’s SSH agent and X11 desktop connections.
- Bound connection setup and detect a dead link
The SSH connection and initial handshake have an eight-second timeout. If SSH receives no data for ten seconds, it sends a keepalive and gives up after three unanswered probes.
- Read the operator’s SSH config
The optional file can specify the host alias, private key, and known-hosts file the Pipal account uses.
- Select the account and destination
Pipal supplies the login user explicitly.
--ends the option list before the destination. - Send the runner as source
The remote shell uses
execto replace itself with Node.js.-eevaluates the quoted source ofdevelopment-runner.mjsas an ES module. Pipal sends the request separately on stdin.
,
,
,
,
,
,
1 Run without a terminal or prompts
-T disables terminal allocation. Batch mode makes authentication fail instead of prompting in a tool call.
The SSH command carries development-runner.mjs each time, and the local launch passes the same source to Node.js. The runner waits for newline-terminated JSON on standard input. Pipal leaves that input open, while the runner starts Bash with stdin ignored or starts a separate Node.js process with the source of project-files.mjs and sends it only the file request before closing the worker’s stdin. Both children inherit the runner’s output streams. development-workspace.ts development-runner.mjs
For This machine, the local branch of invoke() removes NODE_ENV from the environment it passes to the runner. Pipal can run in production while Bash commands choose their own build mode. The local workspace test checks both the unset variable in the command and an explicit override. development-workspace.ts workspace-locations.test.ts
Bash defaults to 60 seconds and accepts an integer from 1 to 3,600 seconds. Core reserves that much time for the tool outside the ordinary response budget. The runner starts its timer after spawning the child. The host starts a backstop at launch and kills the local runner or SSH client after the requested time plus 12 seconds. File operations use 20 seconds on the runner and 32 seconds on the host. Catalog operations and inspection use a 20-second host timer and return before the child timer is installed. project-tool-definitions.ts development-workspace.ts development-runner.mjs index.ts
For Bash the host streams both output channels. For non-streaming requests it caps buffered stdout at 1,048,576 JavaScript string code units and stops the local runner or SSH client on overflow. It keeps the last 2,048 code units of stderr. The shared file worker also caps its input JSON at 1 MiB and each read or write at 512 KiB of file data. development-workspace.ts project-files.mjs
The runner rejects real or effective UID 0 and a username that differs from the request with exit status 1. On a local Mac, createLocalTools() supplies the platform UUID so the identity survives hostname changes. On Linux the runner reads the trimmed /etc/machine-id. The runner resolves the directory and requires its canonical path to match the request. An inode is the filesystem’s identifier for a file or directory. development-runner.mjs development-workspace.ts
async function identify(path) { const root = await realpath(path); const info = await stat(root, { bigint: true }); if (path !== root || !info.isDirectory()) throw new Error('Use a canonical development directory.'); return [machine, process.getuid(), root, String(info.dev), String(info.ino), String(info.birthtimeNs)].join(':');}const actual = await identify(directory).catch(error => { if (operation === 'inspect') throw error; return undefined;});if (operation === 'inspect') { await access(directory, constants.W_OK | constants.X_OK); await access('/bin/bash', constants.X_OK); console.log(JSON.stringify({ identity: actual, machine, uid: process.getuid() })); return;}inspect checks that the account can write to and traverse the directory and can execute /bin/bash. The host requires a nonempty identity string. For SSH it also rejects a login whose machine ID and UID match its own. scoped() computes the approval scope as a hex SHA-256 hash of the JSON array containing the transport (local or ssh), configured host, user, project ID and directory identity. development-runner.mjs development-workspace.ts
For other requests the runner returns status 254 if it cannot match the directory identity. Bash can return 254 too, so invoke() inspects the directory again before removing a stale Bash binding. A new chat can open the replacement and pin its new identity. If the project parent changed and the open fails, retry the location in Settings first. development-runner.mjs development-workspace.ts index.ts
With named entries alone, an openProject runner request creates or verifies .pipal-projects first. A listProjects request checks that it is writable and traversable, or returns an empty list if it is missing. The runner lists real directories that match the name pattern and skips ones that vanish during identification. It opens a new name by creating a directory with mode 0700 or reusing a canonical directory. A file or symlink at the path yields a conflict. development-runner.mjs
For a tool call the runner resolves the real working directory, checks that it is the project root or inside it, and checks that input is still open before it spawns the child. Over SSH, status 255 on a Bash call triggers a read-only inspection because Bash can also exit 255. A 255 on the inspection or another non-Bash request reports the location unavailable. The lifecycle callback closes the binding and notifies watchers, so Settings can offer Retry connection. development-runner.mjs development-workspace.ts workspace-locations.ts
A service can outlive a command and a chat
In the maintainer’s own setup, source maps to /home/pipal-build/source/ on pipal-dev-check. It contains discourse/, discourse-dev/, and .pipal-projects/. Docker runs discourse_dev on that Linux machine. Inside the container, /src points to the same discourse/ checkout, so an edit to the Linux folder changes the file the container sees. The database has its own Docker-managed storage.
The development runner starts Bash and the file helper as ordinary processes. If a command starts an app under Docker, the engine that command talks to manages the app. With Docker selected as the workspace location, Pipal itself creates a container with no network for each Bash call or file-helper operation. Settings and Runtime say “Shell commands run without network access.” project-shell.ts workspace-choice.ts
Developer can still consult public documentation from a Docker chat. The pipal.web-search grant lets a compatible model use its provider’s search. The separate pipal.public-web grant lets the Pipal host search with Exa or pass a public page to Jina Reader. Each grant is opt-in and works independently of the machine running Bash. Tools and extensions traces a lookup. config.example.toml public-web.ts
If the Docker backend has allow_git_clone enabled and the profile has pipal.bash, git_clone fetches a checkout in its own networked stage. project-shell.ts
A new chat on the same project can open the same saved files. It can check a separately managed service if the service is still running and reachable. The opt-in integration test starts a detached container serving a file written through the tool, closes and reopens the runtime, reads the file in another chat, and fetches it from the service. After a development machine reboot, files saved to persistent storage are still there. The service’s restart policy determines whether it starts again. development-workspace.test.ts adr-development-workspace.md
Deep diveHow the open input controls the command’s lifetime
The runner treats the open input stream as a lease, permission for the foreground command to keep running while the pipe or connection holds. On Stop, the host closes the input pipe and signals the local runner or SSH client to terminate. The runner attempts SIGKILL on the child’s process group when input ends, when the runner receives SIGHUP or SIGTERM, when the timer expires, and in cleanup after the child exits or fails to start. That reaches Bash and children still in its group. A service managed by Docker or a user service manager can keep running separately. A timeout prints a message and sets exit code 124. The runner destroys its input stream when the request finishes. development-workspace.ts development-runner.mjs
read, edit, write, and the file read for publish_file take the same lock for a project scope within the open backend. An edit holds the lock from read through write. locks.request() takes the call’s abort signal, so a cancelled waiter can leave the queue. Bash calls and project opens bypass the lock. A build in one chat can overlap a health check or an edit in another, even in the same directory. development-workspace.ts project-coding.ts
For a build that takes several steps, Workers explains how Developer can delegate a longer assignment with its own budget on the same project.
What has to happen before a command gets the account’s permissions in the first place? Approvals and YOLO follows the decision from the chat to the tool.
Recap
- Pipal keeps the conversation on its host. Tools run as the service user on This machine or under the separate login on SSH machine.
- The first Send saves the location, project name and scope with the chat. Choose the same location and project in a new chat to return to that checkout.
- The runner stops the foreground command’s group. Docker or a user service manager can keep an app running independently.
- You select a new project name and close the draft before sending. When does Pipal create the folder?
- When you first type the name
- When the first Send creates a chat with that name
- When Bash first writes a file
Answer and explanation
When the first Send creates a chat with that name
The browser holds the selection in the draft. For a new name, chat creation opens the directory before saving the chat.
- On SSH machine, Developer starts Discourse under Docker on Linux. You restart Pipal while Linux stays up. Where is the running service?
- In the old SSH connection
- In the new Pipal process
- In Docker on the development machine
Answer and explanation
In Docker on the development machine
Docker owns the service. A new chat can select SSH machine and the same project to check it.
- An old chat’s project directory is replaced by a different one at the same path. What makes the replacement usable?
- Open a new chat with the replacement binding loaded
- Reuse the old chat because the path still matches
- Increase Bash’s timeout in the old chat
Answer and explanation
Open a new chat with the replacement binding loaded
The saved binding includes the directory’s identity. The new chat must select the replacement identity.
You select a new project name and close the draft before sending. When does Pipal create the folder?
On SSH machine, Developer starts Discourse under Docker on Linux. You restart Pipal while Linux stays up. Where is the running service?
An old chat’s project directory is replaced by a different one at the same path. What makes the replacement usable?