# Clinic And Manus Batch Capacity

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "clinic-manus-batch-capacity-2026-08-10",
  "problems": [
    {
      "problemId": "clinic-manus-six-query-batch-capacity",
      "summary": "Clinic and Manus remain capped at six queries per provider batch, and Manus additionally restricts queryId to seven fixed semantic names, so already-known load-bearing checks may require an unnecessary later acquisition round.",
      "status": "optimized_unverified",
      "issueKeys": [],
      "sourceRefs": [
        "https://github.com/tidbcloud/aisupport/issues/606#problem:clinic-manus-batch-capacity"
      ],
      "signalTextIncludesAny": [
        "clinic batch capacity exhausted",
        "manus batch capacity exhausted",
        "manus queryId is restricted to a fixed semantic list",
        "already-known supporting queries deferred to another refinement round"
      ],
      "observedThrough": "2026-08-10",
      "effectiveAt": "2026-08-10T06:17:00Z",
      "verifiedAt": null,
      "attemptedAction": "Raise the Clinic concurrent batch and Manus serial batch ceilings from six to twelve, use unique safe-slug query IDs of at most 64 characters, preserve the four-round ceiling, and explicitly treat twelve as capacity rather than a fill target.",
      "evidenceUrl": "https://github.com/tidbcloud/aisupport/actions/runs/31361107651"
    }
  ]
}
-->

- Optimization ID: `clinic-manus-batch-capacity-2026-08-10`
- Owner: auto-oncall-services runner, Clinic helper, and bundled Manus helper
- Source reference: Focus #606 provider-acquisition refinement evidence
- Implementation status: merged and deployed to staging
- Effective status: `optimized_unverified`

## Bounded problem

Clinic and Manus still admit at most six queries per batch after Wetech moved to
a twelve-query capacity. A child that already knows more than six load-bearing
checks must either omit one or spend another full refinement round on agent
planning and parent judgment. Manus also treats `queryId` as a fixed diagnostic
taxonomy even though the runtime only needs a safe artifact key and uniqueness.

This record owns only Clinic and Manus batch/query-key capacity. It does not
change provider concurrency, transport retries, per-query deadlines, the
four-round limit, scenario selection, answer judgment, or Jira publication.

## Candidate change

- Use one shared provider batch capacity of 12 for Clinic, Manus, and Wetech.
- Accept unique query IDs matching `^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$` with at
  most 64 characters.
- Keep Clinic queries concurrent and Manus queries strictly serial.
- Tell acquisition that 12 is a ceiling, not a target, and prohibit filler
  queries.

## Verification evidence

[aisupport PR 710](https://github.com/tidbcloud/aisupport/pull/710) passed CI
with all 703 TypeScript tests and merged the implementation. The bundled Manus
helper passed all 25 Python tests. [Deployment run 31361107651](https://github.com/tidbcloud/aisupport/actions/runs/31361107651)
built the current main image, and [app-delivery PR 76647](https://github.com/tidbcloud/app-delivery/pull/76647)
merged its staging image bump.

The live staging Deployment uses image `c8d2b1b41fa7137937ce6f7c3a82aa05e4178139`.
Its Pod is Ready with zero restarts, and `/readyz` returns HTTP 200. Runtime
imports report four batch rounds, a shared batch maximum of 12, and the safe
query-ID pattern. The installed Manus helper reports
`OP_BATCH_MAX_QUERIES=12` and has no fixed `OP_BATCH_QUERY_IDS` allowlist.

Two synthetic, no-provider-write runtime checks exercised the deployed helper
paths inside the Pod. Clinic accepted and completed twelve independent
component queries with twelve mocked fetches; Manus accepted and completed
twelve strictly serial mocked metric queries through `metric-check-12`.
These checks prove the deployed contracts and handoff capacity, but a real
Clinic or Manus case replay is still required before this problem can become
`optimized_verified`.

## Unresolved gaps

- A larger batch does not reduce provider latency and must not cause low-value
  queries to be added.
- No representative Clinic or Manus case has yet exercised more than six
  queries on the deployed runtime.

## Next validation action

Run a representative read-only Clinic or Manus replay with more than six
load-bearing queries when an applicable case is selected, and verify that the
larger batch avoids an otherwise unnecessary refinement round.
