Skip to main content

A FastAPI-based manager-first agent backend and CLI

Project description

Agent Proxy

agent-proxy is a Python CLI for persistent agent workspaces and Codex session coordination.

The primary commands are:

  • agent-proxy enable
  • agent-proxy restart
  • agent-proxy init <role>
  • agent-proxy hire <role> <name>
  • agent-proxy list
  • agent-proxy status
  • agent-proxy connect <agent> [working_dir]
  • agent-proxy stop <role>

There is also an internal agent-proxy daemon command used by the systemd service.

Features

  • agent-proxy init <role> creates a role workspace with memory and daily notes
  • agent-proxy init <role> asks the daemon to spawn Codex and returns the managed PID
  • agent-proxy hire <role> <name> creates or reuses a named agent and returns its managed PID
  • agent-proxy enable installs and starts the systemd daemon service
  • agent-proxy restart restarts the systemd daemon service
  • agent-proxy restart also allows desired roles to come back under the restarted master
  • if a managed autostart role dies, the daemon will try to restart it after about 10 seconds
  • agent-proxy list shows initialized agents
  • agent-proxy status shows the daemon/agent process tree
  • agent-proxy connect <agent> [working_dir] opens a command-line chatbot for the managed role session
  • agent-proxy stop <role> queues a stop request for the monitor daemon
  • the master also serves an OpenAI Responses-style POST /v1/responses API and a browser chat UI at GET /
  • the master also serves POST /hire for creating named agents
  • when the daemon starts, it also starts the default manager agent

Installation

cd agent-proxy
make install

Installation does not automatically enable the daemon. Use agent-proxy enable explicitly.

Or directly:

pip install -e .

Usage

Initialize a role workspace:

agent-proxy init researcher

This creates:

~/.agent_proxy/researcher/
├── SOUL.md
├── AGENTS.md
├── memory/memory.md
└── notes/daily-YYYY-MM-DD.md

The generated instructions tell the agent to write important long-term information into memory/memory.md and write task summaries into the daily note.

After the workspace is created, agent-proxy init <role> asks the daemon to spawn the role process and prints the managed PID.

Hire a named agent from the CLI:

agent-proxy hire engineer alice

This prints:

engineer_alice 12345

Install and start the systemd service:

agent-proxy enable
agent-proxy enable --ip 0.0.0.0 --port 7011
agent-proxy restart

The command uses sudo internally for the privileged install and systemctl operations. When the daemon comes up, it also creates or reuses ~/.agent_proxy/manager/ and keeps the manager agent running.

List available agents:

agent-proxy list
agent-proxy status

When the master is running, it also serves:

http://0.0.0.0:7011

HTTP responses API:

curl -N http://127.0.0.1:7011/v1/responses \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{"model":"engineer_alice","input":"hello","stream":true}'

/v1/responses follows the OpenAI Responses API shape for request and response payloads. If AGENT_PROXY_API_KEY is configured for the service, API requests must send Authorization: Bearer <key>.

Open http://127.0.0.1:7011/ in a browser for the streaming chat UI.

Hire a named agent:

curl -s http://127.0.0.1:7011/hire \
  -H 'Content-Type: application/json' \
  -d '{"role":"engineer","name":"alice"}'

This creates a workspace like:

~/.agent_proxy/engineer_alice/

Queue a connection request for an agent, defaulting to the current directory:

agent-proxy connect researcher
agent-proxy connect researcher /home/li/project/collection-pip

If the agent becomes ready, connect returns its managed PID. If the daemon cannot make it ready, connect exits with not ready. If the agent becomes ready, connect opens a command-line chatbot loop. If the daemon cannot make it ready, connect exits with not ready.

The optional working_dir argument is task context for the agent. Codex itself still runs from the agent workspace. On connect, the CLI first sends:

Now let us work on working dir: <working_dir>

Queue a stop request for an agent:

agent-proxy stop researcher

Notes

  • connect targets a daemon-managed pseudo-terminal session. The daemon records the message Now let us working on <working_dir> and launches Codex from that directory inside the managed session.
  • after a daemon restart, roles marked for autostart are spawned again by the master
  • the daemon also ensures the default manager agent is running after startup or restart
  • if an autostart role crashes, the master retries it after about 10 seconds instead of leaving it down permanently
  • stop queues a stop request. The daemon terminates the tracked Codex process for that role if it still exists.
  • init is daemon-managed. It returns a PID instead of entering an interactive shell.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

teamclaw_agent_proxy-0.1.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

teamclaw_agent_proxy-0.1.0-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file teamclaw_agent_proxy-0.1.0.tar.gz.

File metadata

  • Download URL: teamclaw_agent_proxy-0.1.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for teamclaw_agent_proxy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 41362e1770b61af5d32e8061c2d6d37e792e6c28fbaa8f3953e6cdf610ada343
MD5 263f98d38a8a8adca966f1bc37e2e0cd
BLAKE2b-256 abd28df14cc523cc82ee44adbfb96eb3e540cb3ebbcdd367ad532b341f2d840e

See more details on using hashes here.

File details

Details for the file teamclaw_agent_proxy-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for teamclaw_agent_proxy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ae201860f173d520c8fa1da3a872f09ec7b438f6cc58daddb69027851656e8a
MD5 b18922f711d7365f87bd2d7a69aeeb2f
BLAKE2b-256 7946b7c6425b08f726870ebae62c3d8a35de76a8e3333cec6e9090a737991130

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page