MCPcopy Create free account
hub / github.com/vercel/examples / create_run

Function create_run

python/vibe-coding-ide/backend/src/api/agent.py:44–71  ·  view source on GitHub ↗
(request: RunRequest)

Source from the content-addressed store, hash-verified

42
43@router.post("/")
44async def create_run(request: RunRequest) -> dict[str, Any]:
45 task_id = make_task_id()
46 try:
47 logger.info(
48 "create_run[%s] model=%s query_len=%d files=%d",
49 task_id,
50 request.model,
51 len(request.query or ""),
52 len(request.project or {}),
53 )
54 except Exception:
55 pass
56
57 # Store full payload server-side to keep stream tokens small
58 await set_run_payload(
59 task_id,
60 {
61 "user_id": request.user_id,
62 "message_history": request.message_history,
63 "query": request.query,
64 "project": request.project,
65 "model": request.model,
66 "project_id": request.project_id,
67 },
68 )
69 # Issue a compact token carrying only the run id
70 stream_token = make_stream_token({"run_id": task_id})
71 return {"task_id": task_id, "stream_token": stream_token}
72
73
74@router.get("/{run_id}/events")

Callers

nothing calls this directly

Calls 3

set_run_payloadFunction · 0.90
make_stream_tokenFunction · 0.90
make_task_idFunction · 0.85

Tested by

no test coverage detected