Skip to main content
An investigation takes a cluster of related issue reports on one agent and works toward a prompt fix: the AI generates hypotheses about the root cause, drafts prompt candidates (you can add your own), each candidate can be tested in an experiment (replaying the failing calls’ inputs against the candidate prompt), and the winning candidate is applied to the agent. Status flow: idlegenerating_hypothesesawaiting_candidatesgenerating_candidatesreadyapplied (or dismissed at any point). Generation steps run asynchronously — poll the detail endpoint.

Endpoints

All ids on this page are UUIDs except agent_id and call_ids.

Investigation object

The list endpoint returns {"results": [...]} with the same fields minus the nested candidates and experiments.

Start an investigation

Returns 201 with the investigation in status="idle".

Drive the workflow

  1. POST …/hypotheses — starts async hypothesis generation (status → generating_hypotheses, then awaiting_candidates). Returns the investigation immediately; 409 if generation is already running or the investigation is in a terminal state.
  2. POST …/candidates — starts async AI candidate generation (status → generating_candidates, then ready). Same 409 semantics.
  3. POST …/candidates/manual — add your own candidate at any non-terminal point: {"label", "prompt", "rationale"?}201 with the new candidate.
  4. POST …/candidates/{candidate_id}/experiments — body {"config": {…}} (optional). Replays the failing calls’ inputs against the candidate prompt asynchronously. Returns 201 with the experiment (status: "running"); poll GET …/experiments/{experiment_id} until completed / failed.
  5. POST …/apply — body {"candidate_id": "…"}. Writes the candidate’s prompt to the agent, records an agent config version, sets status applied, and auto-resolves the investigation’s linked issue reports. Allowed from ready / awaiting_candidates (409 otherwise). Returns the final investigation.
To abandon an investigation: PATCH /v1/investigations/{id} with {"status": "dismissed"}dismissed is the only status a client may set directly.
apply stages the fix in the agent’s draft (your other pending draft edits are preserved; the live prompt is untouched until you deploy). Pass "deploy": true to deploy in the same call, and "with_ack": true on a tier-upgrade candidate to enable acknowledgements at the same time. A 409 means the prompt changed since the fix was tested — re-run the investigation against the current prompt.
POST /v1/investigations/{investigation_id}/search Runs the autonomous fix search: the AI drafts diverse prompt changes (and, for eligible agents, a tier upgrade), screens each one in parallel replays of the AI turn, culls weak variants, and confirms the best result on fresh replays plus calls without the issue. The investigation’s search_result carries the outcome — tier is fixed (eliminated in a confirmation round), improved (a confirmed reduction), or null when nothing held up, in which case the cluster is flagged to ThunderPhone with the replay evidence.

Issue Reports

The raw material investigations start from.

Test Scenarios

Guard the fix with a promoted regression scenario.

Agents

Applied fixes appear in the agent’s version history.

Calls

Evidence calls are ordinary call logs.