Developer workflow for the agent runtime (src/agent/agents/) in the Apus repo.

Type checking and linting

Running Agent Runtime Tests

Run the agent runtime unit suites:

pnpm test \
  "src/agent/agents/agent-*.test.ts" \
  "src/agent/agents/embedded-agent-*.test.ts" \
  "src/agent/agents/agent-hooks/**/*.test.ts"

The first glob also covers the agent-tools*, agent-settings, and agent-tool-definition-adapter* suites.

Live tests are excluded from the unit config; run them through the live wrapper (sets APUS_LIVE_TEST=1 and needs provider credentials):

pnpm test:live src/agent/agents/embedded-agent-runner-extraparams.live.test.ts

Manual testing

For tool call behavior, prompt for a read or exec action so you can watch tool streaming and payload handling.

Clean slate reset

State lives in the Apus state directory: ~/.apus by default, or $APUS_STATE_DIR when set. Paths relative to that directory:

Path Holds
apus.json Config
state/apus.sqlite Shared runtime state database
agents/<agentId>/agent/apus-agent.sqlite Per-agent model auth profiles (API keys + OAuth) and runtime state
credentials/ Provider/channel credentials outside the auth profile store
agents/<agentId>/sessions/ Transcript history and legacy session migration sources
sessions/ Legacy single-agent session store (old installs only)
workspace/ Default agent workspace (extra agents use workspace-<agentId>)

Delete those paths for a full reset. Narrower resets:

Legacy auth-profiles.json files are no longer read at runtime; apus doctor --fix imports them into the SQLite store.

Related