Repository navigation
Description
Context
Today Agent Tank is an external, optional tool. An operator has to install it separately on the host (npm install -g agent-tank), keep it running, and then point ProPR at its HTTP API. ProPR only stores { enabled: boolean, url: string } (see packages/core/src/config/configManagerAgents.ts → AgentTankSettings) and always talks to it over HTTP (packages/core/src/services/agentTankService.ts).
That creates real friction:
- The operator must install a second tool and keep a daemon alive.
- The daemon has to be reachable from inside a container (
http://host.docker.internal:3456), which is the single most common misconfiguration documented indocs/docs/operations/agent-tank.md. - Agent Tank needs the agent CLIs (
claude,codex,agy) installed and authenticated on the same host where it runs — but in a normal ProPR install those CLIs live insidepropr/agent, not on the host. So operators end up installing the CLIs twice.
The current (unreleased) Agent Tank version accepts a config file path directly, which removes the last reason it had to run on the host: we can now generate a config that points at the mounted credential directories and run Agent Tank inside our own agent image, where the CLIs already exist.
This issue bundles Agent Tank into the unified propr/agent image and turns the integration into a three-state setting:
| Mode | Meaning |
|---|---|
disabled |
Default. No usage tracking at all. Identical to today's enabled: false. |
bundled |
ProPR runs the Agent Tank CLI inside the agent image on demand. No host install, no daemon, no networking. |
external |
Today's behavior: talk over HTTP to an Agent Tank the operator runs themselves. |
Upstream reference: https://github.com/integry/agent-tank
Requirements
Functional
AgentTankSettingsgains amode: 'disabled' | 'bundled' | 'external'field.urlis only meaningful inexternalmode.- Backward compatibility is mandatory. Existing persisted settings (
{ enabled: true, url }) must migrate transparently to{ mode: 'external', url }, and{ enabled: false }to{ mode: 'disabled' }. The loaded object must keep returning a derivedenabledboolean so no existing caller breaks. - The default for a fresh install stays disabled. Nothing turns itself on.
- In
bundledmode, ProPR runsagent-tank --once --json --config <generated>inside the configuredpropr/agentimage, with each enabled agent's credential directory bind-mounted at the same container path the agent runtime uses (CONTAINER_CONFIG_PATHS). Output is parsed into the exact sameRecord<string, AgentStatusResponse>shape the HTTP/statusendpoint returns, so every downstream consumer (sidebar, LLM-log deltas, MCP tools, CLI) is unchanged. - Bundled results are cached with a short TTL and coalesced, because
executeWithUsageTrackingprobes usage around every LLM call. Spawning a container per probe is unacceptable. - The Settings UI offers the three modes; the URL field is only shown/editable in
externalmode. propr tankacceptsbundled | external | off(withonkept as a deprecated alias forexternal, since that is what it means for existing users).- The MCP
update_provider_policytool accepts the mode. - Agent Tank is installed into
Dockerfile.agentat a pinned version, so the image ships it.
Non-functional
- Never block a task. Agent Tank stays best-effort: a missing image, a failed container, or a cold cache must degrade to "no usage data", never to a failed run.
- The bundled runner must not add latency to the pre/post-call probes. Those probes read the cache only; refresh happens out of band.
- Supply-chain hygiene: the pinned Agent Tank version participates in the agent bundle image tag, so changing it produces a new image tag (see
test/agentDockerfileSupplyChain.test.tsandtest/agentVersionManagement.test.tsfor the existing conventions).
Implementation Specification
See the implementation section for full diffs. High-level order of work:
- Shared type — add
AgentTankModeand a normalizer inpackages/sharedso core, API, CLI and UI agree on one vocabulary. - Core settings — extend
loadAgentTankSettings/saveAgentTankSettingsinpackages/core/src/config/configManagerAgents.tswith migration from the legacy shape. - Bundled runner — new
packages/core/src/services/agentTankBundledRunner.tsthat builds the config file, runs the container viaexecuteDockerCommand, parses JSON, and owns the TTL cache + in-flight coalescing. - Transport routing —
packages/core/src/services/agentTankService.tspicks HTTP or bundled based on mode;getStatus/refreshAgentkeep their signatures. - Usage wrapper —
isAgentTankEnabledbecomes mode-aware; bundled mode uses cache-only reads. - API routes —
packages/api/routes/configRoutesAgentTank.tsreads/writesmode, andstatus/usage/refreshgo through the transport. - CLI + MCP + UI surfaces.
- Image —
Dockerfile.agentinstall stage,scripts/agent-entrypoint.shdispatch,scripts/build-images.shbuild arg. - Docs + tests.
A note on the Agent Tank config schema
The exact JSON keys accepted by --config must be confirmed against the current integry/agent-tank source before merging. To keep that cheap, all knowledge of the schema lives in exactly one function (buildBundledAgentTankConfig) and one parser (parseBundledAgentTankOutput). If upstream keys differ, only those two functions change. Do not spread config-shape assumptions across the codebase.
Acceptance Criteria
- A fresh install reports
mode: 'disabled'and performs no Agent Tank work of any kind (no HTTP call, no container). - An install that previously had
{ enabled: true, url: 'http://host.docker.internal:3456' }loads as{ mode: 'external', url: 'http://host.docker.internal:3456', enabled: true }and behaves exactly as before. - Switching to
bundledin Settings hides the URL field, and the sidebar Usage section populates without any host-side Agent Tank install. - In
bundledmode, running 10 LLM calls in a row spawns at most one Agent Tank container (cache TTL / coalescing proven by a test with a fake Docker executor). - With the agent image absent or the container failing, tasks still complete and the sidebar simply hides — no thrown errors reach job code.
-
propr tankwith no argument prints the current mode;propr tank bundled,propr tank external --url ..., andpropr tank offall persist correctly;propr tank onstill works and prints a deprecation note. -
docker run --rm propr/agent:<tag> agent-tank --versionsucceeds against a freshly built image. - Changing
ARG AGENT_TANK_CLI_VERSIONinDockerfile.agentchanges the generated bundle image tag. -
npm run lint,npm run typecheck, and the full test suite pass. -
docs/docs/operations/agent-tank.mdanddocs/docs/operations/configuration-reference.mddescribe the three modes and the new env fallbacks.
Implementation
Implementation Approach
Why bundle by running the CLI on demand, rather than shipping a long-lived sidecar container?
The obvious alternative is to add agent-tank as a fourth long-lived service in docker/launcher/orchestrator.mjs (next to api, ui, docs, tunnel) and keep talking HTTP to it at http://propr-agent-tank:3456. That was rejected because:
- It requires launcher manifest changes, a new published image or a new service entry, network aliases, health checks, toggle plumbing in
SERVICES/TOGGLE_SERVICES, and a matching story for source/Compose installs. That is a large surface for an optional feature. - A daemon that idles 24/7 to answer an occasional probe is pure overhead, and it re-introduces exactly the networking class of bug (
localhostvshost.docker.internal) that this issue exists to remove. - Agent Tank already supports one-shot
--once --json, which is precisely the shape we need.
So bundled mode runs a short-lived container per refresh, using the agent image we already build and already know how to mount credentials into. The cost of that decision is latency (container start + PTY-driven /usage calls can take tens of seconds), which is why the runner is built around a TTL cache with in-flight coalescing and the hot path (per-LLM-call probes) only ever reads the cache.
Why a mode enum rather than keeping enabled and adding bundled: boolean?
Two booleans can express nonsense (enabled: false, bundled: true). One enum cannot. The legacy enabled boolean is retained as a derived, read-only field on the loaded object purely so that the dozen existing settings.enabled call sites keep compiling and behaving; it is never the source of truth and is never persisted as the authority.
Why isolate the Agent Tank config schema in one function?
We are integrating against an unreleased upstream version. Confining schema knowledge to buildBundledAgentTankConfig + parseBundledAgentTankOutput means an upstream rename is a two-function change, not a codebase-wide refactor.
File: packages/shared/src/agentTank.ts (new file)
Why this file: core, the API, the CLI, and the UI all need to speak about the same three modes. @propr/shared is the existing home for vocabulary shared across those boundaries (the same way AGENT_TYPES and REASONING_LEVELS live there). Putting the union and its normalizer here prevents four slightly different copies from drifting.
/**
* Agent Tank integration modes.
*
* `disabled` - no usage tracking at all (the default; nothing is contacted).
* `bundled` - ProPR runs the Agent Tank CLI inside the unified agent image.
* `external` - ProPR talks HTTP to an Agent Tank instance the operator runs.
*/
export const AGENT_TANK_MODES = ['disabled', 'bundled', 'external'] as const;
export type AgentTankMode = typeof AGENT_TANK_MODES[number];
export const DEFAULT_AGENT_TANK_MODE: AgentTankMode = 'disabled';
/**
* Coerce an unknown persisted/requested value into a valid mode.
*
* This is deliberately total (never throws): it is called on the read path for
* configuration that may predate this feature, and a corrupt value must degrade
* to "off" rather than break settings loading for the whole installation.
*/
export function normalizeAgentTankMode(value: unknown): AgentTankMode {
return typeof value === 'string' && (AGENT_TANK_MODES as readonly string[]).includes(value)
? value as AgentTankMode
: DEFAULT_AGENT_TANK_MODE;
}
/**
* Migrate the pre-mode persisted shape. Historically the only two states were
* "off" and "talk HTTP to a host install", so a legacy `enabled: true` means
* `external` and never `bundled` - we must not silently change what an existing
* installation is pointed at.
*/
export function agentTankModeFromLegacyEnabled(enabled: unknown): AgentTankMode {
return enabled === true ? 'external' : 'disabled';
}Add the barrel export alongside the other shared modules:
--- a/packages/shared/src/index.ts
+++ b/packages/shared/src/index.ts
@@
export * from './syntheticAgents.js';
+export * from './agentTank.js';File: packages/core/src/config/configManagerAgents.ts
Why this file: it already owns AgentTankSettings and its persistence. Extending it here keeps the migration in the single place that reads the agent_tank config key, so no caller can ever observe an unmigrated object.
--- a/packages/core/src/config/configManagerAgents.ts
+++ b/packages/core/src/config/configManagerAgents.ts
@@
import {
getManagedAgentConfigRelativePath,
+ agentTankModeFromLegacyEnabled,
+ normalizeAgentTankMode,
+ type AgentTankMode,
type AgentType,
type ReasoningLevel
} from '@propr/shared';
@@
/**
* Settings for Agent Tank integration (LLM usage monitoring).
*/
export interface AgentTankSettings {
- enabled: boolean;
+ /** Authoritative integration mode. */
+ mode: AgentTankMode;
+ /**
+ * Derived convenience flag (`mode !== 'disabled'`).
+ *
+ * Kept so the existing `settings.enabled` call sites keep working without a
+ * sweeping refactor. Treat it as read-only: `mode` is the source of truth,
+ * and `saveAgentTankSettings` ignores whatever is passed here.
+ */
+ enabled: boolean;
+ /** Only meaningful in `external` mode. */
url: string;
}
-const DEFAULT_AGENT_TANK_SETTINGS: AgentTankSettings = {
- enabled: false,
- url: 'http://0.0.0.0:3456'
-};
+const DEFAULT_AGENT_TANK_URL = 'http://0.0.0.0:3456';
+
+/**
+ * Environment fallback for headless/automated deployments that configure the
+ * stack entirely through `.env` and never open the Settings UI. Database
+ * settings still win; this only fills in a missing record.
+ */
+function environmentModeFallback(): AgentTankMode | undefined {
+ const raw = process.env.AGENT_TANK_MODE?.trim();
+ if (!raw) return undefined;
+ const normalized = normalizeAgentTankMode(raw);
+ // normalizeAgentTankMode is total, so an unrecognized value silently becomes
+ // 'disabled'. Log it instead of pretending the operator asked for that.
+ if (normalized === 'disabled' && raw !== 'disabled') {
+ logger.warn({ AGENT_TANK_MODE: raw }, 'Unrecognized AGENT_TANK_MODE; treating Agent Tank as disabled');
+ }
+ return normalized;
+}
+
+/**
+ * Accepts both the current `{ mode, url }` shape and the legacy
+ * `{ enabled, url }` shape written before bundled mode existed.
+ */
+function normalizeAgentTankSettings(raw: unknown): AgentTankSettings {
+ const record = (raw && typeof raw === 'object') ? raw as Record<string, unknown> : {};
+ const mode = 'mode' in record
+ ? normalizeAgentTankMode(record.mode)
+ // No `mode` key at all means this record predates the feature (or is
+ // empty). Derive from the legacy boolean, then from the environment.
+ : ('enabled' in record
+ ? agentTankModeFromLegacyEnabled(record.enabled)
+ : environmentModeFallback() ?? 'disabled');
+ const url = typeof record.url === 'string' && record.url.trim()
+ ? record.url.trim()
+ : (process.env.AGENT_TANK_URL?.trim() || DEFAULT_AGENT_TANK_URL);
+ return { mode, enabled: mode !== 'disabled', url };
+}
/**
* Loads Agent Tank settings from the database.
*/
export async function loadAgentTankSettings(): Promise<AgentTankSettings> {
- const settings = await getConfig<AgentTankSettings>('agent_tank', DEFAULT_AGENT_TANK_SETTINGS);
- logger.info({ agentTank: settings }, 'Successfully loaded Agent Tank settings');
- return settings;
+ // Read as `unknown`: the persisted value may be the legacy shape, and the
+ // normalizer is what guarantees callers only ever see the current one.
+ const raw = await getConfig<unknown>('agent_tank', {});
+ const settings = normalizeAgentTankSettings(raw);
+ logger.info({ agentTank: { mode: settings.mode } }, 'Successfully loaded Agent Tank settings');
+ return settings;
}
/**
* Saves Agent Tank settings to the database.
*/
-export async function saveAgentTankSettings(settings: AgentTankSettings): Promise<boolean> {
- await saveConfig('agent_tank', settings);
- logger.info({ agentTank: settings }, 'Successfully saved Agent Tank settings');
+export async function saveAgentTankSettings(
+ settings: Pick<AgentTankSettings, 'mode' | 'url'> & Partial<AgentTankSettings>
+): Promise<boolean> {
+ // Persist the canonical shape only. `enabled` is intentionally written too,
+ // so that a rollback to an older build still reads a sane boolean instead of
+ // defaulting Agent Tank on/off arbitrarily.
+ const mode = normalizeAgentTankMode(settings.mode);
+ const persisted = { mode, enabled: mode !== 'disabled', url: settings.url || DEFAULT_AGENT_TANK_URL };
+ await saveConfig('agent_tank', persisted);
+ logger.info({ agentTank: { mode } }, 'Successfully saved Agent Tank settings');
return true;
}File: packages/core/src/services/agentTankBundledRunner.ts (new file)
Why this file: this is the entire "bundled" implementation, kept out of agentTankService.ts so that the HTTP transport stays readable and so the Docker-specific concerns (image resolution, mounts, timeouts, caching) have one owner. It is also the only place that knows the Agent Tank config file schema, which is what makes an upstream schema change cheap.
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { randomBytes } from 'node:crypto';
import logger from '../utils/logger.js';
import { executeDockerCommand } from '../claude/docker/dockerExecutor.js';
import { loadAgents, resolveConfigPath, resolveCodexConfigPath } from '../config/configManager.js';
import { CONTAINER_CONFIG_PATHS } from '../agents/types.js';
import type { AgentConfig } from '../agents/types.js';
import { toAgentTankAgent } from './agentTankService.js';
import type { AgentStatusResponse } from './agentTankService.js';
/**
* A bundled refresh starts a container and drives interactive `/usage` calls
* through a PTY, so it is slow by nature. Callers never block on it: the hot
* path reads `getCachedBundledStatuses()` and a refresh happens out of band.
*/
const DEFAULT_REFRESH_TIMEOUT_MS = 120_000;
/**
* Provider usage windows move on the order of minutes, so a 60s snapshot is
* plenty fresh for a capacity gauge while keeping container churn near zero.
*/
const DEFAULT_CACHE_TTL_MS = 60_000;
/**
* Past this age a snapshot is too stale to subtract for a per-call delta: two
* LLM calls could both read the same snapshot and report a bogus zero delta, or
* a very old snapshot could attribute unrelated consumption to this call. We
* would rather record no delta than a wrong one.
*/
const DELTA_FRESHNESS_MS = 90_000;
const CONTAINER_CONFIG_FILE = '/tmp/propr-agent-tank/config.json';
interface CachedSnapshot {
agents: Record<string, AgentStatusResponse>;
capturedAt: number;
}
let cached: CachedSnapshot | undefined;
// Coalesces concurrent refresh requests onto a single container run. Without
// this, the sidebar poll and a task's post-call probe could each spawn one.
let inFlight: Promise<Record<string, AgentStatusResponse> | undefined> | undefined;
function timeoutMs(): number {
const parsed = Number.parseInt(process.env.AGENT_TANK_BUNDLED_TIMEOUT_MS || '', 10);
return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_REFRESH_TIMEOUT_MS;
}
function cacheTtlMs(): number {
const parsed = Number.parseInt(process.env.AGENT_TANK_BUNDLED_CACHE_TTL_MS || '', 10);
return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_CACHE_TTL_MS;
}
/**
* Resolve the host path that holds this agent's credentials.
*
* Codex has its own resolver because its portable `~/.codex` default has to be
* mapped through the launcher's host mapping rather than expanded against the
* backend container's HOME. Reusing the agent runtime's own resolvers is what
* guarantees bundled Agent Tank inspects exactly the credentials the agent
* itself would use - not a lookalike directory.
*/
function hostCredentialPath(agent: AgentConfig): string | undefined {
try {
return agent.type === 'codex'
? resolveCodexConfigPath(agent.configPath)
: resolveConfigPath(agent.configPath);
} catch (error) {
logger.debug({ agentAlias: agent.alias, error: (error as Error).message },
'Skipping agent for bundled Agent Tank: credential path is unavailable');
return undefined;
}
}
/**
* ONE OF TWO PLACES that know the Agent Tank config file schema (the other is
* `parseBundledAgentTankOutput`). Confirm against integry/agent-tank before
* merging; if upstream renames keys, change only this function.
*/
export function buildBundledAgentTankConfig(
agents: Array<{ tankAgent: string; home: string }>
): string {
return JSON.stringify({
// One-shot inspection: we never want the HTTP server or its port binding
// inside an ephemeral container.
server: { enabled: false },
agents: agents.map(entry => ({
name: entry.tankAgent,
enabled: true,
// Each CLI reads its own credentials relative to HOME, so we tell
// Agent Tank which HOME to use per agent instead of trying to merge
// several providers' state into one directory.
home: entry.home,
})),
}, null, 2);
}
/**
* ONE OF TWO PLACES that know the Agent Tank output schema. We deliberately
* accept both a bare status map and a `{ agents: {...} }` envelope so a minor
* upstream wrapper change does not break the integration.
*/
export function parseBundledAgentTankOutput(stdout: string): Record<string, AgentStatusResponse> {
const trimmed = stdout.trim();
if (!trimmed) return {};
// `--once --json` may be preceded by banner lines; take the last JSON
// document in the stream rather than assuming the whole buffer parses.
const start = trimmed.indexOf('{');
if (start < 0) return {};
const parsed = JSON.parse(trimmed.slice(start)) as Record<string, unknown>;
const source = (parsed.agents && typeof parsed.agents === 'object')
? parsed.agents as Record<string, unknown>
: parsed;
const agents: Record<string, AgentStatusResponse> = {};
for (const [key, value] of Object.entries(source)) {
if (!value || typeof value !== 'object') continue;
const status = value as Partial<AgentStatusResponse>;
agents[key] = {
name: typeof status.name === 'string' ? status.name : key,
usage: (status.usage && typeof status.usage === 'object')
? status.usage as Record<string, unknown>
: {},
metadata: status.metadata,
lastUpdated: status.lastUpdated,
error: typeof status.error === 'string' ? status.error : null,
};
}
return agents;
}
async function runBundledAgentTank(): Promise<Record<string, AgentStatusResponse> | undefined> {
const agents = (await loadAgents()).filter(agent => agent.enabled);
const mounts: string[] = [];
const entries: Array<{ tankAgent: string; home: string }> = [];
const seen = new Set<string>();
for (const agent of agents) {
const tankAgent = toAgentTankAgent(agent.type);
// Agent Tank tracks a provider, not a ProPR alias. If two aliases share a
// provider we can only report one; the first enabled one wins, matching
// how the sidebar already groups by provider.
if (seen.has(tankAgent)) continue;
const hostPath = hostCredentialPath(agent);
const containerConfigPath = CONTAINER_CONFIG_PATHS[agent.type];
if (!hostPath || !containerConfigPath || !fs.existsSync(hostPath)) continue;
seen.add(tankAgent);
// Read-only: usage inspection must never be able to mutate or corrupt the
// credentials the real agent runs depend on.
mounts.push('-v', `${hostPath}:${containerConfigPath}:ro`);
entries.push({ tankAgent, home: path.dirname(containerConfigPath) });
}
if (entries.length === 0) {
logger.debug('Bundled Agent Tank skipped: no enabled agent has a readable credential directory');
return {};
}
// Resolve the exact image the registry is currently running, so bundled
// Agent Tank always matches the CLI versions the agents actually use.
const { AgentRegistry } = await import('../agents/AgentRegistry.js');
const registry = AgentRegistry.getInstance();
const image = registry.getAllAgents()[0]?.config.dockerImage
|| process.env.AGENT_DOCKER_IMAGE
|| 'propr/agent:latest';
const configDir = fs.mkdtempSync(path.join(os.tmpdir(), 'propr-agent-tank-'));
const configFile = path.join(configDir, 'config.json');
fs.writeFileSync(configFile, buildBundledAgentTankConfig(entries), { mode: 0o600 });
try {
const result = await executeDockerCommand('docker', [
'run', '--rm',
// No inbound/outbound needs beyond the provider APIs the CLIs call;
// we do not add --network none because `/usage` for some providers
// hits the provider API.
'--name', `propr-agent-tank-${randomBytes(6).toString('hex')}`,
'-e', 'PROPR_AGENT_TYPE=agent-tank',
'-v', `${configFile}:${CONTAINER_CONFIG_FILE}:ro`,
...mounts,
image,
'agent-tank', '--once', '--json', '--config', CONTAINER_CONFIG_FILE,
], { timeout: timeoutMs() });
if (result.exitCode !== 0) {
logger.warn({ exitCode: result.exitCode, stderr: result.stderr.slice(0, 500) },
'Bundled Agent Tank run failed');
return undefined;
}
return parseBundledAgentTankOutput(result.stdout);
} catch (error) {
logger.warn({ error: (error as Error).message }, 'Bundled Agent Tank run threw');
return undefined;
} finally {
// Best-effort: the temp file holds no secrets, but leaving one per probe
// would slowly fill the container's tmp.
try { fs.rmSync(configDir, { recursive: true, force: true }); } catch { /* ignore */ }
}
}
/** Cache-only read. Safe on the hot path: never spawns a container. */
export function getCachedBundledStatuses(
options: { maxAgeMs?: number } = {}
): Record<string, AgentStatusResponse> | undefined {
if (!cached) return undefined;
const maxAge = options.maxAgeMs ?? cacheTtlMs();
return Date.now() - cached.capturedAt <= maxAge ? cached.agents : undefined;
}
/** Cache-only read bounded by the delta freshness window. */
export function getBundledStatusesForDelta(): Record<string, AgentStatusResponse> | undefined {
return getCachedBundledStatuses({ maxAgeMs: DELTA_FRESHNESS_MS });
}
/**
* Return a fresh snapshot, reusing the cache when it is young enough and
* coalescing concurrent callers onto one container run.
*/
export async function refreshBundledStatuses(
options: { force?: boolean } = {}
): Promise<Record<string, AgentStatusResponse> | undefined> {
if (!options.force) {
const fresh = getCachedBundledStatuses();
if (fresh) return fresh;
}
if (inFlight) return inFlight;
inFlight = runBundledAgentTank()
.then(agents => {
// Only replace the cache on success: a transient container failure
// should not blank out a perfectly good recent snapshot.
if (agents) cached = { agents, capturedAt: Date.now() };
return agents;
})
.finally(() => { inFlight = undefined; });
return inFlight;
}
/** Fire-and-forget refresh used by hot paths that must not await a container. */
export function scheduleBundledRefresh(): void {
void refreshBundledStatuses().catch(() => { /* best-effort by design */ });
}
/** Test seam. */
export function clearBundledAgentTankCache(): void {
cached = undefined;
inFlight = undefined;
}File: packages/core/src/services/agentTankService.ts
Why this file: it is the single integration boundary every consumer already goes through (getStatus, refreshAgent, normalizeAgentTankAgents). Routing by mode here means the sidebar, the usage wrapper, the API routes, and the MCP tools all get bundled support without knowing it exists.
--- a/packages/core/src/services/agentTankService.ts
+++ b/packages/core/src/services/agentTankService.ts
@@
import logger from '../utils/logger.js';
import { loadAgentTankSettings } from '../config/configManager.js';
+import {
+ getBundledStatusesForDelta,
+ refreshBundledStatuses,
+ scheduleBundledRefresh,
+} from './agentTankBundledRunner.js';
@@
export async function refreshAgent(agent: string, timeoutMs: number = DEFAULT_TIMEOUT_MS): Promise<void> {
+ const settings = await loadAgentTankSettings();
+ if (settings.mode === 'disabled') return;
+ if (settings.mode === 'bundled') {
+ // Bundled refresh means starting a container, which can take a minute.
+ // Callers of refreshAgent (notably the per-LLM-call usage wrapper) run
+ // on a ~2s budget, so we only *schedule* the work here and let the next
+ // read pick up the newer snapshot. Explicit user-driven refreshes go
+ // through the API route, which awaits `refreshBundledStatuses`.
+ scheduleBundledRefresh();
+ return;
+ }
const baseUrl = await getAgentTankBaseUrl();
const tankAgent = toAgentTankAgent(agent);
@@
export async function getStatus(agent: string, timeoutMs: number = DEFAULT_TIMEOUT_MS): Promise<AgentStatusResponse> {
+ const settings = await loadAgentTankSettings();
+ if (settings.mode === 'disabled') {
+ throw new Error('Agent Tank is disabled');
+ }
+ if (settings.mode === 'bundled') {
+ // Cache-only: bounded by the delta freshness window so a stale snapshot
+ // cannot be subtracted to produce a misleading per-call usage delta.
+ const agents = getBundledStatusesForDelta();
+ const tankAgent = toAgentTankAgent(agent);
+ const status = agents?.[tankAgent];
+ if (!status) {
+ throw new Error(`No fresh bundled Agent Tank snapshot for ${agent}`);
+ }
+ return normalizeAgentTankStatus(status);
+ }
const baseUrl = await getAgentTankBaseUrl();
const tankAgent = toAgentTankAgent(agent);
@@
} finally {
clearTimeout(timer);
}
}
+
+/**
+ * Transport-agnostic "give me every provider's usage" used by the sidebar and
+ * the MCP usage tool. Returns `undefined` when tracking is disabled or no data
+ * is available, so callers can hide the UI rather than render an error.
+ */
+export async function getAllStatuses(
+ options: { refresh?: boolean } = {}
+): Promise<Record<string, AgentStatusResponse> | undefined> {
+ const settings = await loadAgentTankSettings();
+ if (settings.mode === 'disabled') return undefined;
+ if (settings.mode === 'bundled') {
+ const agents = await refreshBundledStatuses({ force: options.refresh === true });
+ return agents ? normalizeAgentTankAgents(agents) : undefined;
+ }
+
+ const controller = new AbortController();
+ const timer = setTimeout(() => controller.abort(), DEFAULT_TIMEOUT_MS);
+ try {
+ const response = await fetch(`${settings.url}/status`, { signal: controller.signal });
+ if (!response.ok) return undefined;
+ const data = await response.json() as Record<string, AgentStatusResponse>;
+ return normalizeAgentTankAgents(data);
+ } catch {
+ return undefined;
+ } finally {
+ clearTimeout(timer);
+ }
+}Export the new surface from the package barrel:
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@
export {
toAgentTankAgent,
toProprAgent,
normalizeAgentTankStatus,
- normalizeAgentTankAgents
+ normalizeAgentTankAgents,
+ getAllStatuses as getAgentTankStatuses
} from './services/agentTankService.js';
export type { AgentStatusResponse } from './services/agentTankService.js';
+export {
+ buildBundledAgentTankConfig,
+ parseBundledAgentTankOutput,
+ refreshBundledStatuses,
+ getCachedBundledStatuses,
+ clearBundledAgentTankCache
+} from './services/agentTankBundledRunner.js';File: packages/core/src/agents/impl/utils/usageTrackingWrapper.ts
Why this file: this is the hot path — it wraps every LLM call. It currently short-circuits on settings.enabled; that check must become mode-aware so disabled stays a true zero-cost no-op and bundled never awaits a container start.
--- a/packages/core/src/agents/impl/utils/usageTrackingWrapper.ts
+++ b/packages/core/src/agents/impl/utils/usageTrackingWrapper.ts
@@
export async function isAgentTankEnabled(): Promise<boolean> {
- const settings = await loadAgentTankSettings();
- return settings.enabled;
+ const settings = await loadAgentTankSettings();
+ // `enabled` is derived from `mode`, so this keeps working for both modes
+ // while remaining an explicit, single-line gate for the disabled default.
+ return settings.mode !== 'disabled';
}No other change is needed here: refreshAgent and getStatus already encapsulate the transport, and in bundled mode they are non-blocking (schedule + cached read) by construction. If the cache is cold, getStatus throws, the existing try/catch records no usage metrics, and the LLM call proceeds normally — exactly the "best-effort" contract documented today.
File: packages/api/routes/configRoutesAgentTank.ts
Why this file: it is the read/write surface the Settings UI, the CLI, and the MCP tools all hit. It must persist the mode and route status/usage/refresh through the transport rather than hard-coding fetch.
--- a/packages/api/routes/configRoutesAgentTank.ts
+++ b/packages/api/routes/configRoutesAgentTank.ts
@@
import { Request, Response } from 'express';
import * as configManager from '@propr/core';
-import { normalizeAgentTankAgents, type AgentStatusResponse } from '@propr/core';
+import { getAgentTankStatuses, refreshBundledStatuses } from '@propr/core';
+import { AGENT_TANK_MODES, normalizeAgentTankMode } from '@propr/shared';
@@
async function postAgentTankSettings(req: Request, res: Response): Promise<void> {
try {
- const { enabled, url } = req.body;
- await configManager.saveAgentTankSettings({ enabled: !!enabled, url: url || 'http://0.0.0.0:3456' });
+ const { mode, enabled, url } = req.body ?? {};
+ // Accept the legacy `{ enabled }` body so older CLI builds and any
+ // in-flight clients keep working during a rolling upgrade.
+ const resolvedMode = mode === undefined
+ ? (enabled === true ? 'external' : 'disabled')
+ : normalizeAgentTankMode(mode);
+ if (mode !== undefined && !AGENT_TANK_MODES.includes(resolvedMode)) {
+ res.status(400).json({ error: `mode must be one of: ${AGENT_TANK_MODES.join(', ')}` });
+ return;
+ }
+ if (resolvedMode === 'external' && typeof url === 'string' && url.trim() === '') {
+ res.status(400).json({ error: 'url is required when mode is "external"' });
+ return;
+ }
+ await configManager.saveAgentTankSettings({ mode: resolvedMode, url: url || 'http://0.0.0.0:3456' });
res.json({ success: true });
} catch (error) {
console.error('Error in /api/config/agent-tank POST:', error);
res.status(500).json({ error: 'Failed to save Agent Tank settings' });
}
}
@@
async function getAgentTankStatus(_req: Request, res: Response): Promise<void> {
try {
const settings = await configManager.loadAgentTankSettings();
- if (!settings.enabled) {
+ if (settings.mode === 'disabled') {
res.json({ available: false, reason: 'disabled' });
return;
}
+ if (settings.mode === 'bundled') {
+ // "Available" for bundled mode means "we can produce a snapshot",
+ // which is exactly what a (cached) refresh answers. Reusing the same
+ // call keeps the status indicator honest instead of asserting health
+ // from image presence alone.
+ const agents = await refreshBundledStatuses();
+ res.json(agents ? { available: true, mode: 'bundled' } : { available: false, reason: 'bundled_run_failed' });
+ return;
+ }
const controller = new AbortController();
@@
async function getAgentTankUsage(_req: Request, res: Response): Promise<void> {
try {
const settings = await configManager.loadAgentTankSettings();
- if (!settings.enabled) {
+ if (settings.mode === 'disabled') {
res.json({ enabled: false });
return;
}
- const controller = new AbortController();
- const timer = setTimeout(() => controller.abort(), 5000);
- try {
- const response = await fetch(`${settings.url}/status`, { signal: controller.signal });
- clearTimeout(timer);
- if (response.ok) {
- const data = await response.json() as Record<string, AgentStatusResponse>;
- res.json({ enabled: true, agents: normalizeAgentTankAgents(data) });
- } else {
- res.json({ enabled: true, error: `HTTP ${response.status}` });
- }
- } catch {
- clearTimeout(timer);
- res.json({ enabled: true, error: 'unreachable' });
- }
+ // One transport-agnostic call: the UI response shape is unchanged, so
+ // AgentTankSidebar needs no modification for bundled mode.
+ const agents = await getAgentTankStatuses();
+ res.json(agents
+ ? { enabled: true, mode: settings.mode, agents }
+ : { enabled: true, mode: settings.mode, error: settings.mode === 'bundled' ? 'bundled_run_failed' : 'unreachable' });
} catch (error) {
console.error('Error in /api/config/agent-tank/usage GET:', error);
res.status(500).json({ error: 'Failed to fetch Agent Tank usage' });
}
}
@@
async function postAgentTankRefresh(_req: Request, res: Response): Promise<void> {
try {
const settings = await configManager.loadAgentTankSettings();
- if (!settings.enabled) {
+ if (settings.mode === 'disabled') {
res.json({ success: false, error: 'Agent Tank not enabled' });
return;
}
+ if (settings.mode === 'bundled') {
+ // `force` because this is an explicit operator action: they pressed
+ // refresh precisely because they do not trust the cached snapshot.
+ const agents = await refreshBundledStatuses({ force: true });
+ res.json(agents ? { success: true } : { success: false, error: 'bundled_run_failed' });
+ return;
+ }
const controller = new AbortController();Also update getAgentTankDetect so the detection banner only fires in disabled mode and explicitly offers bundled first (it is now the lower-friction option), keeping external detection as the fallback hint.
File: packages/cli/src/api/agentTank.ts
Why this file: the CLI's typed wrapper must carry the mode, or propr tank bundled cannot be expressed at all.
--- a/packages/cli/src/api/agentTank.ts
+++ b/packages/cli/src/api/agentTank.ts
@@
import { ApiClient, createApiClient } from "./index.js";
+import type { AgentTankMode } from "@propr/shared";
export interface AgentTankSettings {
+ mode: AgentTankMode;
enabled: boolean;
url?: string;
}
@@
-/** Enable or disable Agent Tank usage tracking, optionally setting the URL. */
-export async function setAgentTank(
- enabled: boolean,
- url?: string,
- client?: ApiClient
-): Promise<AgentTankSettings> {
+/** Set the Agent Tank integration mode, optionally setting the external URL. */
+export async function setAgentTank(
+ mode: AgentTankMode,
+ url?: string,
+ client?: ApiClient
+): Promise<AgentTankSettings> {
const apiClient = client ?? (await createApiClient());
- // Preserve the existing URL when the caller doesn't pass one.
+ // Preserve the existing URL when the caller doesn't pass one, so switching to
+ // bundled and back to external does not lose a hand-tuned endpoint.
let resolvedUrl = url;
if (!resolvedUrl) {
const current = await getAgentTank(apiClient);
resolvedUrl = current.url || DEFAULT_AGENT_TANK_URL;
}
- await apiClient.post("/api/config/agent-tank", { body: { enabled, url: resolvedUrl } });
- return { enabled, url: resolvedUrl };
+ await apiClient.post("/api/config/agent-tank", { body: { mode, url: resolvedUrl } });
+ return { mode, enabled: mode !== "disabled", url: resolvedUrl };
}File: packages/cli/src/commands/tankCommands.ts
Why this file: propr tank on|off no longer expresses the state space. It gains the three modes while keeping on working, because breaking an existing documented command for no reason is gratuitous.
--- a/packages/cli/src/commands/tankCommands.ts
+++ b/packages/cli/src/commands/tankCommands.ts
@@
+import { AGENT_TANK_MODES, type AgentTankMode } from "@propr/shared";
+
+/**
+ * `on` is kept as a deprecated alias for `external` rather than for `bundled`:
+ * an existing user typing `propr tank on` today means "use my host install",
+ * and silently repointing them at a container would change behavior under them.
+ */
+function parseTankMode(value: string): AgentTankMode | undefined {
+ const normalized = value.trim().toLowerCase();
+ if (normalized === "off") return "disabled";
+ if (normalized === "on") return "external";
+ return (AGENT_TANK_MODES as readonly string[]).includes(normalized)
+ ? normalized as AgentTankMode
+ : undefined;
+}The command action becomes: no argument prints Mode: <mode> (plus the URL only for external); an argument is parsed with parseTankMode, rejected with the list of valid values if unrecognized, printed with a deprecation note for on, and passed to setAgentTank. Add a --url <url> option that is only accepted with external.
File: propr-ui/src/pages/SettingsPage/AgentTankSection.tsx
Why this file: the settings surface is where the operator actually chooses. A single checkbox cannot express three states, so it becomes a radio group; the URL field is conditionally rendered because an external URL is meaningless in bundled mode and showing it would imply otherwise.
--- a/propr-ui/src/pages/SettingsPage/AgentTankSection.tsx
+++ b/propr-ui/src/pages/SettingsPage/AgentTankSection.tsx
@@
-import { SettingsCheckboxField, SettingsField, SettingsSection, SettingsStatus } from './SettingsLayout';
+import { SettingsField, SettingsSection, SettingsStatus } from './SettingsLayout';
import { SETTINGS_CONTROL } from './settingsStyles';
+import type { AgentTankMode } from '@propr/shared';
export interface AgentTankSettings {
+ mode: AgentTankMode;
enabled: boolean;
url: string;
}
+
+const MODE_OPTIONS: Array<{ value: AgentTankMode; label: string; description: string }> = [
+ {
+ value: 'disabled',
+ label: 'Disabled',
+ description: 'No usage tracking. Nothing is contacted or started.',
+ },
+ {
+ value: 'bundled',
+ label: 'Bundled (recommended)',
+ description: 'ProPR runs Agent Tank inside the agent image using your configured agent credentials. No host install and no networking required.',
+ },
+ {
+ value: 'external',
+ label: 'External installation',
+ description: 'Talk to an Agent Tank daemon you run yourself over HTTP.',
+ },
+];Replace the SettingsCheckboxField with a radio group rendered from MODE_OPTIONS (each option calls onChange({ ...settings, mode: option.value })), and wrap the existing Daemon URL SettingsField in {settings.mode === 'external' && ( ... )}. Keep the live connection status block, but only render it for external and bundled — with bundled the label should read "Bundled Agent Tank ready" / "Bundled Agent Tank unavailable" so the operator is not told about an unreachable URL that is not in use.
propr-ui/src/pages/SettingsPage/useSettingsState.ts must have its Agent Tank state initialized to { mode: 'disabled', enabled: false, url: '' } and pass mode through to saveAgentTankSettings. propr-ui/src/components/AgentTankDetectionBanner.tsx should have its "Enable" button call enableAgentTank with mode: 'bundled' when no external instance was detected, and mode: 'external' with the detected URL when one was.
File: Dockerfile.agent
Why this file: this is the whole point of the issue — Agent Tank has to be in the image. It gets its own build stage so a version bump does not invalidate the cache for any agent CLI, matching the established pattern for claude-cli, codex-cli, etc. agent-base already installs build-essential and python3, which node-pty (Agent Tank's native dependency) needs.
--- a/Dockerfile.agent
+++ b/Dockerfile.agent
@@
FROM agent-base AS vibe-cli
@@
+FROM agent-base AS agent-tank-cli
+# Pinned here, not in CI: this literal is part of the Dockerfile content that
+# feeds the agent bundle content hash, so bumping it produces a new image tag.
+# An env-only override in CI would NOT change the tag and would silently ship a
+# different binary under an existing tag - do not do that.
+ARG AGENT_TANK_CLI_VERSION=1.4.0
+USER root
+# node-pty compiles against the toolchain already present in agent-base
+# (build-essential + python3), which is why this needs no extra apt packages.
+RUN npm install -g "agent-tank@${AGENT_TANK_CLI_VERSION}" \
+ && npm cache clean --force \
+ && rm -rf /root/.npm \
+ && agent-tank --version
+
+
FROM agent-base AS final
ARG CLAUDE_CLI_VERSION=2.1.280
@@
ARG VIBE_CLI_VERSION=2.25.4
+ARG AGENT_TANK_CLI_VERSION=1.4.0
LABEL dev.propr.agent-bundle="true" \
dev.propr.agent.claude.version="${CLAUDE_CLI_VERSION}" \
@@
- dev.propr.agent.vibe.version="${VIBE_CLI_VERSION}"
+ dev.propr.agent.vibe.version="${VIBE_CLI_VERSION}" \
+ dev.propr.agent-tank.version="${AGENT_TANK_CLI_VERSION}"
@@
COPY --from=opencode-cli /usr/local/lib/node_modules/opencode-ai /usr/local/lib/node_modules/opencode-ai
+COPY --from=agent-tank-cli /usr/local/lib/node_modules/agent-tank /usr/local/lib/node_modules/agent-tank
@@
link_npm_bin opencode-ai opencode \
+ && link_npm_bin agent-tank agent-tank \
&& ln -sf /home/node/.local/bin/agy /usr/local/bin/agy \
@@
&& opencode --version \
&& vibe --version \
- && agy --version
+ && agy --version \
+ && agent-tank --versionFile: scripts/agent-entrypoint.sh
Why this file: the shared entrypoint currently classifies the first argument to pick an agent type and repair that agent's mounted credential ownership before dropping privileges. Agent Tank reads several providers' credentials read-only, so it must not trigger any single provider's ownership repair — and it must still drop to the node user.
--- a/scripts/agent-entrypoint.sh
+++ b/scripts/agent-entrypoint.sh
@@
opencode-run|/usr/local/bin/opencode-run) agent_type=opencode ;;
+ # Agent Tank inspects every provider's credentials read-only, so it owns no
+ # single agent type and must skip per-agent ownership repair. Mounts are :ro
+ # by construction in the bundled runner, so there is nothing to chown.
+ agent-tank|/usr/local/bin/agent-tank) agent_type=agent-tank ;;In the ownership-repair block, guard with if [ "$agent_type" != "agent-tank" ]; then ... fi so no chown runs for this path, then fall through to the existing privilege-drop.
File: scripts/build-images.sh
Why this file: it owns the build args and the bundle-tag derivation. The Agent Tank version must be passed through so a build can pin it, and the CLI-version override must stay consistent with the Dockerfile default.
--- a/scripts/build-images.sh
+++ b/scripts/build-images.sh
@@
VIBE_CLI_VERSION="${VIBE_CLI_VERSION:-2.25.4}"
+AGENT_TANK_CLI_VERSION="${AGENT_TANK_CLI_VERSION:-1.4.0}"
@@
agent)
build_args+=(
"--build-arg" "CLAUDE_CLI_VERSION=$CLAUDE_CLI_VERSION"
@@
"--build-arg" "VIBE_CLI_VERSION=$VIBE_CLI_VERSION"
+ "--build-arg" "AGENT_TANK_CLI_VERSION=$AGENT_TANK_CLI_VERSION"
)
;;Note in a comment near the AGENT_TANK_CLI_VERSION default that it must be kept identical to the ARG default in Dockerfile.agent, because only the Dockerfile literal participates in the content hash. Add a test assertion for that equality next to the existing CLAUDE_CLI_VERSION/CODEX_CLI_VERSION checks in test/agentVersionManagement.test.ts.
File: packages/api/mcp/toolsConfiguration.ts
Why this file: update_provider_policy currently only takes { enabled, url }. Leaving it boolean-only would make bundled mode unreachable from MCP and would make the tool a lying abstraction over the real setting.
--- a/packages/api/mcp/toolsConfiguration.ts
+++ b/packages/api/mcp/toolsConfiguration.ts
@@
- workflow(tools, { name: 'update_provider_policy', description: 'Configure the existing Agent Tank provider service with a non-secret HTTP(S) base URL and explicit enabled state. Requires instance.manage_agents.', scope: 'manage', permission: 'instance.manage_agents', schema: z.object({ ...mutationShape, enabled: z.boolean(), url: z.url().max(2048).refine(...) }).strict() }, config.postAgentTankSettings, args => ({ body: { enabled: args.enabled, url: args.url.replace(/\/$/, '') } }));
+ workflow(tools, {
+ name: 'update_provider_policy',
+ description: 'Configure Agent Tank usage tracking. "bundled" runs it inside the ProPR agent image and needs no url; "external" targets an operator-run instance at a non-secret HTTP(S) base URL. Requires instance.manage_agents.',
+ scope: 'manage',
+ permission: 'instance.manage_agents',
+ schema: z.object({
+ ...mutationShape,
+ mode: z.enum(AGENT_TANK_MODES),
+ // Optional because it is meaningless outside external mode; the refine
+ // below makes it required exactly when it matters, so the tool cannot be
+ // called into an inconsistent state.
+ url: z.url().max(2048).optional(),
+ }).strict().refine(
+ args => args.mode !== 'external' || typeof args.url === 'string',
+ { message: 'url is required when mode is "external"' },
+ ),
+ }, config.postAgentTankSettings, args => ({ body: { mode: args.mode, url: args.url } }));Tests
Why these: each guards a distinct failure mode that would be expensive to find in production.
test/agentTankSettingsMigration.test.ts(new) — asserts{ enabled: true, url }loads asmode: 'external',{ enabled: false }as'disabled',{}as'disabled', a corruptmodeas'disabled', and thatAGENT_TANK_MODE=bundledonly applies when no record exists. This is the one that protects every existing installation.test/agentTankBundledRunner.test.ts(new) — with a mockedexecuteDockerCommand, assert: (a) ten concurrentrefreshBundledStatuses()calls produce exactly onedocker run; (b) a second call inside the TTL produces zero; (c) a non-zero exit code leaves the previous cache intact and returnsundefined; (d) mounts are:roand useCONTAINER_CONFIG_PATHS; (e)parseBundledAgentTankOutputhandles both the bare map and the{ agents }envelope, and tolerates banner text before the JSON.test/agentTankService.test.ts— extend to cover mode routing: disabled throws/returns undefined without any fetch or Docker call; bundled never callsfetch; external is unchanged.test/agentVersionManagement.test.ts— assertDockerfile.agentcontainsARG AGENT_TANK_CLI_VERSION=<version>and thatscripts/build-images.shdefaults to the same literal.test/agentDockerfileSupplyChain.test.ts— assert the Agent Tank install is a pinnedagent-tank@<version>and not an unpinned orlatestinstall.propr-ui/src/pages/SettingsPage/AgentTankSection.test.tsx(new) — the URL field is absent fordisabled/bundledand present forexternal; selecting a mode callsonChangewith the right mode.
Docs
docs/docs/operations/agent-tank.md— restructure around the three modes. Bundled becomes the recommended path and the "Run Agent Tank" / "Networking" sections move under an "External installation" heading, since they no longer apply to most readers. Be explicit that bundled mode reads the same credential directories the agents use, read-only, and that its data is a cached snapshot refreshed on demand rather than a live daemon.docs/docs/operations/configuration-reference.md— documentAGENT_TANK_MODE,AGENT_TANK_BUNDLED_TIMEOUT_MS,AGENT_TANK_BUNDLED_CACHE_TTL_MS, and clarify thatAGENT_TANK_URLnow applies only toexternalmode.dockerhub/agent.md— mention that the image now also bundles the Agent Tank CLI, so readers auditing image contents are not surprised.
Activity
propr-dev commentedon Sep 26, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-52547/claude-opus-5-bundle-agent-tank-into-th-20260926-1849-t18mainissue-2547-20260926-1849-claude-opus-5-t18🔍 Track Task Execution
Implementation complete. Summary of what I built for #2547: