chore(agent): update && simplify readme (#39584)

This commit is contained in:
Yunlu Wen
2026-07-26 05:08:58 +00:00
committed by GitHub
parent ac0320a70d
commit 1d34184999
+8 -33
View File
@@ -2,21 +2,16 @@
Go implementation of the shellctl server and runtime utilities.
This is a rewrite of the Python `shellctl` package (`dify-agent/src/shellctl/` and
`dify-agent/src/shellctl_runtime/`). The original Python code is kept as reference.
## Architecture
```
cmd/
shellctl/ main server binary (shellctl serve)
sanitize-pty/ tmux pipe-pane PTY sanitizer (stdin→stdout filter)
runner-exit/ post-drain SQLite exit recorder
internal/
sanitize/ — PTY ANSI stripping + CR normalization
runner_exit/ — SQLite CAS update for job exit
server/ — HTTP API, job service, tmux controller, output reader
shellctl/ - main server binary (shellctl serve)
sanitize-pty/ - tmux pipe-pane PTY sanitizer (stdin→stdout filter)
runner-exit/ - post-drain SQLite exit recorder
dify-agent-cli/ - cli tool talking to agent backend
runner/ - process runner to bootstrap agent commands
internal/ - internal implementations
```
## Building
@@ -27,11 +22,6 @@ make build
Produces binaries in `bin/`:
- `shellctl` — the main server (`shellctl serve --listen 0.0.0.0:5004`)
- `shellctl-sanitize-pty` — PTY sanitizer for tmux pipe-pane
- `shellctl-runner-exit` — exit state writer
- `shellctl-runner` — job runner with integrated Landlock isolation
### Building docker image
```
@@ -78,27 +68,12 @@ The runner automatically creates `$CWD/.tmp` and sets `TMPDIR`, `TMP`, `TEMP` to
### Environment Variables
| Variable | Default | Description |
| -------------------------------- | --------------- | ------------------------------------------------ |
| `SHELLCTL_ENABLE_PATH_ISOLATION` | `true` | Set to `false` to disable Landlock entirely |
| `SHELLCTL_LANDLOCK_RW_PATHS` | _(empty)_ | Comma-separated RW directories (besides `$HOME`) |
| `SHELLCTL_LANDLOCK_RO_PATHS` | `/usr,/bin,...` | Comma-separated RO+exec directories |
| `SHELLCTL_LANDLOCK_RW_DEV_PATHS` | `/dev/null,...` | Comma-separated device files with RW access |
See [here](./internal/envvar/envvar.go)
Requires Linux ≥ 5.13. On unsupported kernels, a warning is printed to stderr.
## Dependencies
- Go 1.23+
- Go 1.26
- `modernc.org/sqlite` (pure-Go SQLite driver, no CGO required)
- tmux (runtime dependency, not a build dependency)
## Migration from Python
The Go binaries are drop-in replacements for the Python console scripts:
- `shellctl-sanitize-pty` replaces the Python `shellctl-sanitize-pty` entrypoint
- `shellctl-runner-exit` replaces the Python `shellctl-runner-exit` entrypoint
- `shellctl serve` replaces the Python `shellctl serve` (FastAPI/uvicorn)
The HTTP API contract, SQLite schema, and filesystem artifact layout are identical.