HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.
Python agent-apiagent-frameworkagent-harnessai-agentsai-infrastructurecoding-agentconformance-testingdeepseek-harnessharness-engineeringhermesllmopen-protocolopen-sourceopen-standardpi-coding-agentself-hosteduhpunified-apiunified-harness-protocolunified-interface
fix(console): Add is the verb
richard-epsilla4dbfda42051e
diff --git a/ui/src/components/CloudUploadCard.tsx b/ui/src/components/CloudUploadCard.tsxindex 2bea8f6c..b4923356 100644--- a/ui/src/components/CloudUploadCard.tsx+++ b/ui/src/components/CloudUploadCard.tsx@@ -2,26 +2,19 @@// Settings: the stored cloud workspaces. Add with a key, remove any time. One sentence of// contract. Self-hosted only.import { useEffect, useState } from 'react';-import { addTarget, listTargets, removeTarget, testKey, type CloudTarget } from '@/lib/cloud-upload';+import { addTarget, listTargets, removeTarget, type CloudTarget } from '@/lib/cloud-upload';export function CloudUploadCard() {const [targets, setTargets] = useState<CloudTarget[] | null>(null);const [key, setKey] = useState('');- const [tested, setTested] = useState<string | null>(null);const [busy, setBusy] = useState(false);const [err, setErr] = useState<string | null>(null);useEffect(() => { listTargets().then((r) => setTargets(r.targets)).catch(() => setTargets([])); }, []);- async function test() {- setBusy(true); setErr(null);- try { setTested((await testKey(key.trim())).label); }- catch (e) { setErr(e instanceof Error ? e.message : String(e)); setTested(null); }- finally { setBusy(false); }- }async function add(e: React.FormEvent) {e.preventDefault(); setBusy(true); setErr(null);- try { await addTarget(key.trim()); setKey(''); setTested(null); setTargets((await listTargets()).targets); }+ try { await addTarget(key.trim()); setKey(''); setTargets((await listTargets()).targets); }catch (er) { setErr(er instanceof Error ? er.message : String(er)); }finally { setBusy(false); }}@@ -55,13 +48,10 @@ export function CloudUploadCard() {<div className="field"><label htmlFor="cloudKey">Add a workspace</label><div className="cloud-keyrow"><input id="cloudKey" type="password" autoComplete="off" placeholder="sk-hr-" value={key}- onChange={(e) => { setKey(e.target.value); setTested(null); }} />- <button className="button" type="button" disabled={busy || !key.trim()} onClick={() => void test()}>Test</button>- <button className="button primary" type="submit" disabled={busy || !key.trim()}>Add</button>+ onChange={(e) => setKey(e.target.value)} />+ <button className="button primary" type="submit" disabled={busy || !key.trim()}>{busy ? 'Adding…' : 'Add'}</button></div>- {tested- ? <span className="field-help"><span className="status healthy">{tested}</span></span>- : <span className="field-help">From the cloud console, inside the workspace, under Keys.</span>}+ <span className="field-help">From the cloud console, inside the workspace, under Keys.</span></div>{err && <div className="notice"><iconify-icon icon="tabler:alert-triangle"></iconify-icon><div>{err}</div></div>}</div>diff --git a/ui/src/components/CloudUploadDialog.tsx b/ui/src/components/CloudUploadDialog.tsxindex 1336ae43..829069b7 100644--- a/ui/src/components/CloudUploadDialog.tsx+++ b/ui/src/components/CloudUploadDialog.tsx@@ -3,7 +3,7 @@// with "Add a workspace" inline: paste a key, Test shows where it lands, and the upload uses it.// Rows run independently on the server; each answers for itself here.import { useEffect, useState } from 'react';-import { addTarget, listTargets, testKey, uploadMany, type CloudTarget, type UploadRow } from '@/lib/cloud-upload';+import { addTarget, listTargets, uploadMany, type CloudTarget, type UploadRow } from '@/lib/cloud-upload';export interface UploadItem { id: string; name: string; builtin?: boolean; includes?: string; uploaded?: boolean }const ADD = '__add__';@@ -14,7 +14,6 @@ export function CloudUploadDialog({ items, onClose, onDone }: {const [targets, setTargets] = useState<CloudTarget[] | null>(null);const [choice, setChoice] = useState<string>('');const [key, setKey] = useState('');- const [tested, setTested] = useState<string | null>(null);const [busy, setBusy] = useState(false);const [err, setErr] = useState<string | null>(null);const [rows, setRows] = useState<UploadRow[] | null>(null);@@ -28,25 +27,27 @@ export function CloudUploadDialog({ items, onClose, onDone }: {const single = items.length === 1;const adding = choice === ADD;- async function test() {+ async function add() {+ // One verb: Add verifies the key, stores the workspace, and the picker lands on it.setBusy(true); setErr(null);- try { setTested((await testKey(key.trim())).label); }- catch (e) { setErr(e instanceof Error ? e.message : String(e)); setTested(null); }+ try {+ const t = await addTarget(key.trim());+ const r = await listTargets();+ setTargets(r.targets); setChoice(t.id); setKey('');+ } catch (e) { setErr(e instanceof Error ? e.message : String(e)); }finally { setBusy(false); }}async function run() {setBusy(true); setErr(null);try {- let targetId = choice;- if (adding) { const t = await addTarget(key.trim()); targetId = t.id; }- const r = await uploadMany(eligible.map((i) => i.id), targetId);+ const r = await uploadMany(eligible.map((i) => i.id), choice);setRows(r.results); onDone?.(r.results);} catch (e) { setErr(e instanceof Error ? e.message : String(e)); }finally { setBusy(false); }}const title = single ? `Upload "${items[0].name}"` : `Upload ${eligible.length} to cloud`;- const canUpload = !busy && eligible.length > 0 && (!adding || (key.trim().length > 0 && tested !== null));+ const canUpload = !busy && eligible.length > 0 && !adding;return (<div className="modal-backdrop" onClick={onClose}>@@ -80,12 +81,10 @@ export function CloudUploadDialog({ items, onClose, onDone }: {<div className="field"><label htmlFor="cloudKey">Workspace API key</label><div className="cloud-keyrow"><input id="cloudKey" type="password" autoComplete="off" placeholder="sk-hr-" value={key}- onChange={(e) => { setKey(e.target.value); setTested(null); }} />- <button className="button" type="button" disabled={busy || !key.trim()} onClick={() => void test()}>Test</button>+ onChange={(e) => setKey(e.target.value)} />+ <button className="button primary" type="button" disabled={busy || !key.trim()} onClick={() => void add()}>{busy ? 'Adding…' : 'Add'}</button></div>- {tested- ? <span className="field-help"><span className="status healthy">{tested}</span></span>- : <span className="field-help">From the cloud console, inside the workspace, under Keys.</span>}+ <span className="field-help">From the cloud console, inside the workspace, under Keys.</span></div>)}{single && (diff --git a/ui/src/lib/cloud-upload.ts b/ui/src/lib/cloud-upload.tsindex 80910c56..6930ac0b 100644--- a/ui/src/lib/cloud-upload.ts+++ b/ui/src/lib/cloud-upload.ts@@ -10,7 +10,6 @@ export interface UploadRow { id: string; ok: boolean; action: 'create' | 'replacexport const listTargets = () => gw<{ targets: CloudTarget[]; last: string }>('GET', '/v1/cloud-upload/targets');export const addTarget = (api_key: string) => gw<CloudTarget>('POST', '/v1/cloud-upload/targets', { api_key });-export const testKey = (api_key: string) => gw<{ ok: true; label: string }>('POST', '/v1/cloud-upload/targets/test', { api_key });export const removeTarget = (id: string) => gw<{ targets: CloudTarget[]; last: string }>('DELETE', `/v1/cloud-upload/targets?id=${encodeURIComponent(id)}`);export const uploadOne = (id: string, target: string) => gw<UploadRow & { status: CloudStatus }>('POST', `/v1/harnesses/${encodeURIComponent(id)}/upload`, { target });export const uploadMany = (ids: string[], target: string) => gw<{ results: UploadRow[]; target: CloudTarget }>('POST', '/v1/harnesses/upload', { ids, target });