MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / testAgentConfig

Function testAgentConfig

ui/src/components/workspace/api.ts:716–734  ·  view source on GitHub ↗
(
  wsId: string,
  agent: AgentId,
  cfg: AgentTestInput,
)

Source from the content-addressed store, hash-verified

714}
715
716export async function testAgentConfig(
717 wsId: string,
718 agent: AgentId,
719 cfg: AgentTestInput,
720): Promise<AgentTestResult> {
721 const res = await fetch(
722 `/api/workspaces/${encodeURIComponent(wsId)}/agent-config/${agent}/test`,
723 {
724 method: 'POST',
725 headers: { 'content-type': 'application/json' },
726 body: JSON.stringify(cfg),
727 },
728 );
729 try {
730 return (await res.json()) as AgentTestResult;
731 } catch {
732 return { ok: false, error: `HTTP ${res.status}` };
733 }
734}

Callers 1

handleTestFunction · 0.90

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected