You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add setup support for agent enablement and image-based authentication #1605
Setup needs to detect which coding agents are usable, offer to enable selected agents in ProPR, and authenticate through the agent Docker images. Host-level agent runtime installation is not required, but the selected agent images must be available.
Requirements
Reuse agent metadata from shared model definitions where possible.
For selected agents, add or update backend agent configuration after the stack is running.
Use planAgentLogin() for image-based authentication where available.
Pull only selected agent images.
Do not disable or delete existing agents when setup is re-run.
Implementation Specification
Add packages/cli/src/commands/setup/agents.ts and call it from the setup engine after stack startup. This can be a follow-up patch to the engine from the earlier issue.
Acceptance Criteria
Existing enabled agents remain enabled.
Selected new agents are added if missing.
Authentication is attempted only for agents with an image login plan and only when the user confirms.
Agent setup is split out because it crosses image management, credentials, backend API writes, and optional interactive Docker login. Keeping it separate from the main engine prevents the setup runner from becoming a large procedural file. The helper uses add-if-missing semantics because re-running setup should not erase custom models, aliases, or user edits.
File: packages/cli/src/commands/setup/agents.ts (new file)
Why this file: This file owns setup-specific agent configuration. It connects selected agent choices to backend agent records and optional Docker-based login.
import{spawnSync}from'node:child_process';import{mkdtempSync,mkdirSync,rmSync}from'node:fs';import{tmpdir}from'node:os';import{join}from'node:path';import{AGENT_DEFAULTS,typeAgentType}from'@propr/shared';import{addAgent,listAgents,typeAgentConfig}from'../../api/agents.js';importtype{ApiClient}from'../../api/client.js';importtype{OrchestratorConfig,OrchestratorModule}from'../../orchestrator/index.js';import{planAgentLogin}from'../agentValidation.js';importtype{SetupPrompts}from'./engine.js';functionhasAgent(existing: AgentConfig[],type: AgentType): boolean{returnexisting.some((agent)=>agent.type===type||agent.alias.toLowerCase()===AGENT_DEFAULTS[type].defaultAlias.toLowerCase());}exportasyncfunctionensureSelectedAgents(selectedAgents: AgentType[],client: ApiClient,orch: OrchestratorModule,cfg: OrchestratorConfig,prompts: SetupPrompts,onMessage: (message: string)=>void=()=>{}): Promise<void>{if(selectedAgents.length===0)return;constexisting=(awaitlistAgents(client)).agents;for(consttypeofselectedAgents){constdefaults=AGENT_DEFAULTS[type];if(!hasAgent(existing,type)){// Use the shared model defaults so setup creates the same baseline agent// catalog the UI expects. Existing custom agents are preserved by only// adding when no matching type or default alias exists.awaitaddAgent({alias: defaults.defaultAlias,
type,models: defaults.defaultModels,defaultModel: defaults.defaultModels[0],dockerImage: defaults.dockerImage,enabled: true,},client);onMessage(`Added ${defaults.defaultAlias} agent.`);}else{onMessage(`Keeping existing ${type} agent configuration.`);}}for(consttypeofselectedAgents){constshouldLogin=awaitprompts.confirm(`Authenticate ${type} through its ProPR Docker image now?`,false);if(!shouldLogin)continue;consttmp=mkdtempSync(join(tmpdir(),'propr-setup-login-'));constworkspaceDir=join(tmp,'workspace');mkdirSync(workspaceDir,{recursive: true});try{const{ plan, error }=planAgentLogin(type,cfg,workspaceDir,orch.validateDockerBindPath);if(error||!plan){onMessage(`${type} login skipped: ${error??'no login plan available'}`);continue;}mkdirSync(plan.hostDir,{recursive: true,mode: 0o700});// Inherit stdio because these vendor login flows may open browser/device// prompts and require a real terminal attached to docker -it.constresult=spawnSync('docker',plan.dockerArgs,{stdio: 'inherit'});if(result.status!==0)onMessage(`${type} login exited with code ${result.status??'?'}.`);}finally{rmSync(tmp,{recursive: true,force: true});}}}
File: packages/cli/src/commands/setup/engine.ts
Why this file: The engine needs to invoke agent enablement after the stack is running because agent configuration is persisted through the backend API.
Activity
propr-dev commentedon Jun 22, 2026
Suggested Implementation:
Implementation Approach
Agent setup is split out because it crosses image management, credentials, backend API writes, and optional interactive Docker login. Keeping it separate from the main engine prevents the setup runner from becoming a large procedural file. The helper uses add-if-missing semantics because re-running setup should not erase custom models, aliases, or user edits.
File:
packages/cli/src/commands/setup/agents.ts(new file)Why this file: This file owns setup-specific agent configuration. It connects selected agent choices to backend agent records and optional Docker-based login.
File:
packages/cli/src/commands/setup/engine.tsWhy this file: The engine needs to invoke agent enablement after the stack is running because agent configuration is persisted through the backend API.
propr-dev commentedon Jun 22, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-4-8 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-4-81605/claude-opus-4-8-add-setup-support-for-age-20260622-1045-bjc1599-epic-build-comprehensive-b5cissue-1605-20260622-1045-claude-opus-4-8-bjc🔍 Track Task Execution
Everything is wired consistently. Here's a summary of what I implemen…
Everything is wired consistently. Here's a summary of what I implemen…