OpenAgentd / appv3
AGENTS.md211 starsChanged 2 months agoApache-2.0View on GitHub
appv3/ is the native openagentd backend. It ships as the CLI release binary and as the desktop sidecar (desktop/sidecar-bundle/bin/openagentd). It reads the database and config files of the end-of-life Python backend in app/. Its HTTP/SSE/WebSocket API started as v2's and now differs where REPORT.md says. - core: settings, XDG paths, auth policy (auth.rs), path safety (security.rs), errors, platform plumbing (which, home, proctree). - db: SQLite pool, queries (reading v2-era rows too), and the replayed Alembic chain. - api: axum routes,…
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- app/AGENTS.mdAGENTS.md
- desktop/AGENTS.mdAGENTS.md
- documents/AGENTS.mdAGENTS.md
- mobile/AGENTS.mdAGENTS.md
- .openagentd/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- web/AGENTS.mdAGENTS.md
The file
Files
Rust Backend (v3) Guide
appv3/ is the native openagentd backend. It ships as the CLI release
binary and as the desktop sidecar (desktop/sidecar-bundle/bin/openagentd).
It reads the database and config files of the end-of-life Python backend in
app/. Its HTTP/SSE/WebSocket API started as v2's and now differs where
REPORT.md says.
Crate map
core: settings, XDG paths, auth policy (auth.rs), path safety (security.rs), errors, platform plumbing (which,home,proctree).db: SQLite pool, queries (reading v2-era rows too), and the replayed Alembic chain.api: axum routes, middleware (auth, Origin/Host guard, CORS, panic → 500), startup/shutdown.agent: turn loop, hooks, sessions, SSE broadcaster and stream store, snapshots, scheduler.providers,tools,mcp,memory,terminal,jsplugin: the model providers, built-in tools, MCP client, memory pages, PTY terminal, and the QuickJS plugin host.cli: theopenagentdbinary (server serveis the sidecar entry point).contract/: data shared with other surfaces.sse_events.jsonlists every SSE event type per stream. Rust checks each published event against it (agent/src/events.rs; debug builds panic), andweb/src/__tests__/api/sse-contract.test.tschecks the web unions. A new event needs the JSON entry, the Rust producer, and the web type/handler.
Safety constraints
- Validate externally supplied workspace roots with
agent::manager::validate_workspace(routes:validate_workspace_or_422) and resolve paths inside them with the existingsafe_join/safe_resolveroute helpers. Do not join untrusted paths by hand. - Compare secrets with
core::auth::constant_time_eq. - The network guard in
api/src/middleware.rsrefuses foreignHostheaders and cross-origin callers when no access key is set. Do not widen it, the auth exempt paths, or the CORS default without explicit approval. server serveremovescore::auth::CHILD_ENV_SECRETSfrom its own environment at startup, so no child process (shell tool, terminal, git, MCP, plugins) inherits the desktop token or access key. Add any new secret that arrives via the environment to that list.- Spawn processes with argument lists (
Command::new(..).args(..)), applyproctree::hide_window, and kill process trees throughproctree. - A panic inside a turn becomes an ordinary turn error, and a handler panic becomes a plain 500. Treat both as bugs, not error handling: return errors.
Checks
From the repository root:
make verify-v3 # cargo fmt --check, clippy -D warnings, all testsWhile iterating, run cargo fmt --all (see rustfmt.toml) and focused
crates, e.g. cargo test -p appv3-api, from this directory. Integration
tests that spawn server serve (crates/cli/tests/) build the binary and
use throw-away HOME/XDG roots; never point tests at real user data.
API or event changes also need make verify-web.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

