Copy-for-AI prompt
The prompt the API returns for a failed attempt, ready for an assistant with the repository open.
Get a test’s attempts in a run, with the Copy-for-AI prompt. Every attempt of one test in one run, oldest first, each with its errors, code frame and a ready-made prompt for an assistant that has the repository open (null for an attempt without a real failure). Cheap.
curl "https://app.squally.dev/api/v1/projects/$PROJECT/runs/{runId}/tests/{testName}" \ -H "Authorization: Bearer $SQUALLY_API_KEY"The copyPrompt field
Section titled “The copyPrompt field”A prompt for an assistant that has the repository open, byte-identical to the Copy for AI button. null for an attempt without a real failure (a pass, a test.fail() marker, no error text).
Example
Section titled “Example”The prompt for a first try that failed and passed on retry (invented data):
You have the repository open. Find the test below, explain the failure and propose a fix.
Failing test: chromium > checkout.spec.ts > Checkout > applies a coupon codeFile: tests/checkout.spec.tsBrowser: chromiumRun branch: mainAttempt: first tryOutcome: a later retry of this test passed (the test is flaky rather than consistently broken).
Error message:Error: expect(locator).toHaveText(expected) failed
Locator: getByTestId('order-total')Expected: "€ 45.00"Received: "€ 50.00"Timeout: 5000msStack (top frames):at /home/runner/work/storefront-web/tests/checkout.spec.ts:48:52Attempt duration: 6210 msFailure category: AssertionStatus from the flakiness engine: flaky (signals: Retry rate). Treat this as evidence to weigh, not as a verdict.Every parameter and the whole response: API reference.