Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions apps/web/e2e/data/agents.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ const mcp = (label, url, allowed = null, credential = null) => ({
...(credential ? { x_agents_core: { credential_id: credential } } : {}),
});
const str = (description) => ({ type: "string", description });
/** Core reports both reasoning members, null when unset. */
const reasoning = (effort = null, summary = null) => ({ effort, summary });

export const agentDefinitions = [
{
name: "Incident responder", model: "gpt-5.1-codex", harness: "codex", reasoning: { effort: "high", summary: "auto" },
name: "Incident responder", model: "gpt-5.1-codex", harness: "codex", reasoning: reasoning("high", "auto"),
instructions: "You are the on-call assistant for the web platform.\n\nWhen an alert arrives:\n1. Read the alert and the linked dashboard.\n2. Check recent deploys and error logs for the affected service.\n3. Propose the smallest safe mitigation and wait for approval before acting.\n4. Write a short incident note: impact, timeline, cause, next steps.",
tools: [
fn("lookup_deploys", "List deploys of a service in a time window.", { service: str("Service name"), since: str("ISO-8601 start") }),
Expand All @@ -23,7 +25,7 @@ export const agentDefinitions = [
metadata: { team: "sre", tier: "production", runbook: "RB-0142" },
},
{
name: "Support triage", model: "claude-sonnet-5", harness: "claude_sdk", reasoning: {},
name: "Support triage", model: "claude-sonnet-5", harness: "claude_sdk", reasoning: reasoning(),
instructions: "Classify each incoming support ticket by product area and severity.\nAsk one clarifying question when the report lacks steps to reproduce.\nNever promise dates. Link the matching help-center article when one exists.",
tools: [
fn("search_help_center", "Search published help-center articles.", { query: str("Search text") }),
Expand All @@ -32,13 +34,13 @@ export const agentDefinitions = [
metadata: { team: "support", queue: "tier-1" },
},
{
name: "Code reviewer", model: "gpt-5.1-codex", harness: "codex", reasoning: { effort: "medium" },
name: "Code reviewer", model: "gpt-5.1-codex", harness: "codex", reasoning: reasoning("medium"),
instructions: "Review pull requests for correctness first, then clarity.\nComment only on issues that matter; group nits into one comment.\nFlag missing tests for changed behaviour.",
tools: [mcp("github", "https://mcp.example.com/github", ["get_pull_request", "list_files", "create_review"])],
metadata: { team: "platform", repo_scope: "monorepo" },
},
{
name: "Data analyst", model: "MiniMax-M2", harness: "mcode", reasoning: {},
name: "Data analyst", model: "MiniMax-M2", harness: "mcode", reasoning: reasoning(),
instructions: "Answer questions about product metrics using the warehouse.\nShow the SQL you ran and state the time range and filters explicitly.\nIf data is missing, say so instead of estimating.",
tools: [
fn("run_sql", "Run a read-only SQL query against the analytics warehouse.", { sql: str("SELECT statement") }),
Expand All @@ -47,37 +49,37 @@ export const agentDefinitions = [
metadata: { team: "data", warehouse: "analytics" },
},
{
name: "Contract checker", model: "gpt-5.1-mini", harness: "codex", reasoning: {},
name: "Contract checker", model: "gpt-5.1-mini", harness: "codex", reasoning: reasoning(),
instructions: "Compare a supplier contract against the standard template.\nList every deviation with the clause number, the template wording and the contract wording.\nMark liability, termination and data-protection deviations as high priority.",
tools: [fn("fetch_template", "Fetch the current standard contract template.", { kind: str("Contract type") })],
metadata: { team: "legal" },
},
{
name: "Release notes writer", model: "claude-sonnet-5", harness: "claude_sdk", reasoning: {},
name: "Release notes writer", model: "claude-sonnet-5", harness: "claude_sdk", reasoning: reasoning(),
instructions: "Draft release notes from merged pull requests since the last tag.\nGroup by user-visible change; leave out refactors and CI changes.",
tools: [mcp("github", "https://mcp.example.com/github", ["list_merged_pull_requests", "get_release"])],
metadata: { team: "platform", channel: "stable" },
},
{
name: "Onboarding guide", model: "gpt-5.1-mini", harness: "codex", reasoning: {},
name: "Onboarding guide", model: "gpt-5.1-mini", harness: "codex", reasoning: reasoning(),
instructions: "Help new employees find internal documentation and set up their accounts.\nKeep answers short and link the source page.",
tools: [mcp("docs", "https://mcp.internal.example/docs", null)],
metadata: { team: "people-ops" },
},
{
name: "Churn forecaster", model: "MiniMax-M2", harness: "mcode", reasoning: { effort: "high" },
name: "Churn forecaster", model: "MiniMax-M2", harness: "mcode", reasoning: reasoning("high"),
instructions: "Estimate 90-day churn risk per account from usage and support signals.\nExplain the top three drivers for each high-risk account.",
tools: [fn("run_sql", "Run a read-only SQL query against the analytics warehouse.", { sql: str("SELECT statement") })],
metadata: { team: "data", model_version: "2026-09" },
},
{
name: "Log summarizer", model: "gpt-5.1-codex", harness: "codex", reasoning: {},
name: "Log summarizer", model: "gpt-5.1-codex", harness: "codex", reasoning: reasoning(),
instructions: "Summarise error logs for the last hour: top error signatures, first seen, count, affected hosts.",
tools: [mcp("observability", "https://mcp.internal.example/observability", ["query_logs"])],
metadata: { team: "sre" },
},
{
name: "Staging smoke tester", model: "gpt-5.1-mini", harness: "codex", reasoning: {},
name: "Staging smoke tester", model: "gpt-5.1-mini", harness: "codex", reasoning: reasoning(),
instructions: "Run the staging smoke checklist after each deploy and report failures with request IDs.",
tools: [fn("http_check", "Call an endpoint and return status and latency.", { url: str("Absolute URL") })],
metadata: { team: "qa", environment: "staging" },
Expand All @@ -91,13 +93,13 @@ export const agentDefinitions = [
*/
export const providerAgentDefinitions = [
{
id: "agent_11c4f2a8", name: "Spec drafter", model: "MiniMax-M2", reasoning: {},
id: "agent_11c4f2a8", name: "Spec drafter", model: "MiniMax-M2", reasoning: reasoning(),
instructions: "Draft a product spec from the linked discussion: problem, users, scope, open questions.",
tools: [], metadata: { team: "product" },
x_agents_core: { model_provider: { protocol: "anthropic", base_url: "https://api.minimaxi.com/anthropic", api_key_configured: true, context_window: 204800, max_output_tokens: 65536 } },
},
{
id: "agent_12d7e3b9", name: "Research assistant", model: "kimi-k2", reasoning: {},
id: "agent_12d7e3b9", name: "Research assistant", model: "kimi-k2", reasoning: reasoning(),
instructions: "Answer research questions with cited sources and a one-paragraph summary.",
tools: [], metadata: { team: "research" },
x_agents_core: { harness: "codex", model_provider: { protocol: "responses", base_url: "https://api.moonshot.cn/v1", api_key_configured: true } },
Expand Down
8 changes: 4 additions & 4 deletions apps/web/e2e/data/routes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function buildDemo(now = Math.floor(Date.now() / 1000), publicUrl = "http
const turnOutput = Math.floor(200 + rand() * 4000);
const turnId = uuid();
const turn = {
id: turnId, agent_id: agent.id, session_id: id, object: "agent.session.turn",
id: turnId, agent_id: agent.id, subagent_id: null, session_id: id, object: "agent.session.turn",
status: running ? "in_progress" : failed ? "failed" : rand() < 0.03 ? "cancelled" : "completed",
created_at: cursor, started_at: cursor + Math.floor(rand() * 4), completed_at: running ? null : cursor + duration,
error: failed ? { code: "internal_error", message: "The execution could not complete." } : null,
Expand All @@ -57,15 +57,15 @@ export function buildDemo(now = Math.floor(Date.now() / 1000), publicUrl = "http
if (!running) { input += turnInput; output += turnOutput; cached += Math.floor(turnInput * 0.4); reasoning += Math.floor(turnOutput * 0.3); }
sessionTurns.push(turn);
const exchange = (agentConversations[agent.name] ?? [["Investigate", "Done"]])[t % (agentConversations[agent.name]?.length ?? 1)];
sessionItems.push({ id: uuid(), turn_id: turnId, type: "message", status: "completed", role: "user", content: [{ type: "input_text", text: exchange[0] }] });
sessionItems.push({ id: uuid(), turn_id: turnId, type: "message", status: "completed", role: "user", phase: null, content: [{ type: "input_text", text: exchange[0] }] });
const calls = Math.floor(rand() * 6);
for (let c = 0; c < calls; c += 1) {
const kind = pick(["function", "function", "mcp", "command", "command", "web"]);
const itemFailed = rand() < 0.06;
if (kind === "function") sessionItems.push({ id: uuid(), turn_id: turnId, type: "function_call", status: itemFailed ? "failed" : "completed", call_id: uuid(), name: pick(["apply_patch", "read_file", "search_docs"]), arguments: {} });
if (kind === "mcp") sessionItems.push({ id: uuid(), turn_id: turnId, type: "mcp_call", status: itemFailed ? "failed" : "completed", server_label: pick(["github", "linear"]), name: pick(["search_issues", "get_file"]), arguments: {}, output: null, error: null });
if (kind === "command") sessionItems.push({ id: uuid(), turn_id: turnId, type: "command_execution", status: "completed", command: "pytest -q", exit_code: itemFailed ? 1 : 0, duration_ms: 1200 });
if (kind === "web") sessionItems.push({ id: uuid(), turn_id: turnId, type: "web_search_call", status: "completed" });
if (kind === "command") sessionItems.push({ id: uuid(), turn_id: turnId, type: "command_execution", status: "completed", command: "pytest -q", cwd: "/workspace", output: itemFailed ? "1 failed, 41 passed" : "42 passed", exit_code: itemFailed ? 1 : 0, duration_ms: 1200 });
if (kind === "web") sessionItems.push({ id: uuid(), turn_id: turnId, type: "web_search_call", status: "completed", action: null });
}
if (!running && !failed) sessionItems.push({ id: uuid(), turn_id: turnId, type: "message", status: "completed", role: "assistant", phase: "final_answer", content: [{ type: "output_text", text: exchange[1] }] });
}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/features/dashboard/runtime-history.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const session = {
model: "fixture/model",
instructions: null,
multi_agent: { enabled: false, max_concurrent_subagents: null },
reasoning: {},
reasoning: { effort: null, summary: null },
service_tier: "auto",
text: { format: { type: "text" }, verbosity: "medium" },
tools: [],
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/features/dashboard/runtime-trends.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function snapshot(at: number, options: {
model: "fixture/model",
instructions: null,
multi_agent: { enabled: false, max_concurrent_subagents: null },
reasoning: {},
reasoning: { effort: null, summary: null },
service_tier: "auto",
text: { format: { type: "text" }, verbosity: "medium" },
tools: [],
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/features/metrics/agent-metrics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function turn(id: string, sessionId: string, overrides: Partial<AgentTurn> = {})
return {
id,
agent_id: "agent",
subagent_id: null,
session_id: sessionId,
object: "agent.session.turn",
status: "completed",
Expand Down Expand Up @@ -144,7 +145,7 @@ describe("helpers", () => {
});

function page<T extends { id: string }>(data: T[], hasMore: boolean): ListPage<T> {
return { data, has_more: hasMore, last_id: data[data.length - 1]?.id ?? null };
return { object: "list", data, first_id: data[0]?.id ?? null, last_id: data[data.length - 1]?.id ?? null, has_more: hasMore };
}

describe("loadAgentMetricsActivity", () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/features/sessions/SessionTurnsTable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { AgentTurn, SessionItem } from "@oac/agents-client";
import { SessionTurnsTable } from "./SessionTurnsTable";

function turn(id: string, overrides: Partial<AgentTurn> = {}): AgentTurn {
return { id, agent_id: "agent", session_id: "session", object: "agent.session.turn", status: "completed", created_at: 1, started_at: 10, completed_at: 14, error: null, usage: null, ...overrides };
return { id, agent_id: "agent", subagent_id: null, session_id: "session", object: "agent.session.turn", status: "completed", created_at: 1, started_at: 10, completed_at: 14, error: null, usage: null, ...overrides };
}

const item = (id: string, turnId: string) => ({ id, turn_id: turnId, type: "message", status: "completed", role: "user", content: [] }) as SessionItem;
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/features/sessions/session-history.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function item(id: string, status: SessionItem["status"], turn = "t1"): SessionIt
}

function turn(id: string, status: AgentTurn["status"], overrides: Partial<AgentTurn> = {}): AgentTurn {
return { id, agent_id: "agent", session_id: "session", object: "agent.session.turn", status, created_at: 1, started_at: null, completed_at: null, error: null, usage: null, ...overrides };
return { id, agent_id: "agent", subagent_id: null, session_id: "session", object: "agent.session.turn", status, created_at: 1, started_at: null, completed_at: null, error: null, usage: null, ...overrides };
}

function list<T extends { id: string }>(data: T[], hasMore = false): ListPage<T> {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/features/sessions/session-log.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function session(id: string, overrides: Partial<AgentSession> & { agentId?: stri
name: agentName,
instructions: null,
multi_agent: { enabled: false, max_concurrent_subagents: null },
reasoning: {},
reasoning: { effort: null, summary: null },
service_tier: "auto",
text: { format: { type: "text" }, verbosity: "medium" },
tools: [],
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/features/sessions/session-queries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function item(id: string, status: SessionItem["status"]): SessionItem {
}

function turn(id: string, status: AgentTurn["status"]): AgentTurn {
return { id, agent_id: "agent", session_id: "session", object: "agent.session.turn", status, created_at: 1, started_at: null, completed_at: null, error: null, usage: null };
return { id, agent_id: "agent", subagent_id: null, session_id: "session", object: "agent.session.turn", status, created_at: 1, started_at: null, completed_at: null, error: null, usage: null };
}

function list<T extends { id: string }>(data: T[]): ListPage<T> {
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/features/sessions/trace/TraceView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const session: AgentSession = {
name: "Fixture Agent",
instructions: "Use durable evidence.",
multi_agent: { enabled: false, max_concurrent_subagents: null },
reasoning: {},
reasoning: { effort: null, summary: null },
service_tier: "auto",
text: { format: { type: "text" }, verbosity: "medium" },
tools: [{
Expand All @@ -39,6 +39,7 @@ function turn(id: string, overrides: Partial<AgentTurn> = {}): AgentTurn {
return {
id,
agent_id: "agent-1",
subagent_id: null,
session_id: session.id,
object: "agent.session.turn",
status: "completed",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/features/sessions/trace/trace-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function turn(id: string, overrides: Partial<AgentTurn> = {}): AgentTurn {
return {
id,
agent_id: "agent-1",
subagent_id: null,
session_id: "session-1",
object: "agent.session.turn",
status: "completed",
Expand Down
Loading
Loading