microsoft/autogen · error · Error
Failed to create run
Error message
Failed to create run
What it means
Thrown by SessionAPI.createRun when POST /runs/ returns falsy status. The payload is {session_id, user_id}; on success it reads data.data.run_id. Failure means the backend refused to start a run — invalid session reference, missing team, or agent-run initialization error surfaced through the envelope.
Source
Thrown at python/packages/autogen-studio/frontend/src/components/views/playground/api.ts:131
}
);
const data = await response.json();
if (!data.status)
throw new Error(data.message || "Failed to fetch messages");
return data.data;
}
// New method to create a run
async createRun(sessionId: number, userId: string): Promise<number> {
const payload = { session_id: sessionId, user_id: userId };
const response = await fetch(`${this.getBaseUrl()}/runs/`, {
method: "POST",
headers: this.getHeaders(),
body: JSON.stringify(payload),
});
const data = await response.json();
if (!data.status) throw new Error(data.message || "Failed to create run");
return data.data.run_id;
}
}
export const sessionAPI = new SessionAPI();
View on GitHub (pinned to 027ecf0a37)
Solutions
- Check data.message and backend logs together — run creation failures are almost always logged with the agent build error
- Verify sessionAPI.getSession(sessionId, userId) succeeds and references a valid team
- Ensure the team's components (model keys, agent configs) are complete before starting a run
- Validate required API keys (e.g. model provider keys) exist in backend settings
Defensive patterns
Strategy: validation
Validate before calling
const session = await sessionAPI.getSession(sessionId, userId);
if (!session?.team) throw new Error("Session has no team — cannot start a run"); Type guard
function isRunCreatedEnvelope(x: unknown): x is { status: true; data: { run_id: number } } {
return !!x && (x as any).status === true && typeof (x as any).data?.run_id === "number";
} Try / catch
try {
return await sessionAPI.createRun(sessionId, userId);
} catch (e) {
notify(`Run not started: ${e instanceof Error ? e.message : e}`);
throw e;
} Prevention
- Verify session and team integrity before exposing the Run button
- Ensure model API keys are present in settings — agent build fails without them
- Check backend logs whenever data.message is vague here; the real error is server-side
When it happens
Trigger: POST /runs/ with a session_id that doesn't exist or lacks a valid team, user_id not matching the session owner, or backend error while constructing the agent runtime for the session's team.
Common situations: Run started before the session's team finished saving, team component references broken (deleted from gallery), backend agent-building error (bad model config keys, missing API keys) wrapped as status:false. Fix order matters: verify the session and its team first, then the backend logs for the agent construction trace.
Related errors
- Failed to fetch session runs
- Failed to fetch sessions
- Failed to fetch session
- Failed to create session
- Failed to update session
AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15).
Data as JSON: /api/errors/ea92000579031a52.
Report an issue: GitHub.