Skip to content

docs(k8s-proxy-llm-workflow): point Routine A at legacy /tr MCP tools#863

Merged
charankamarapu merged 4 commits into
mainfrom
docs/fix-llm-workflow-mcp-tool-names
May 27, 2026
Merged

docs(k8s-proxy-llm-workflow): point Routine A at legacy /tr MCP tools#863
charankamarapu merged 4 commits into
mainfrom
docs/fix-llm-workflow-mcp-tool-names

Conversation

@charankamarapu
Copy link
Copy Markdown
Contributor

Summary

keploy cloud replay --branch-name uploads its report into the legacy /tr collection (testrunReports in Mongo, served by the listTestReports / getTestReport / getTestReportFull MCP tools). The page #862 just merged was pointing Routine A at the api-testing test-suite-run surface instead (listTestRuns({kind: \"test_suite_run\"}) + get_session_report), which queries a different collection and returns a different report shape.

Concretely, an agent running the playbook as written would:

  • Phase A1 — listTestRuns({kind: \"test_suite_run\"}) returns nothing for the dev's branch (the run lives in testrunReports, not testSuiteRun). Agent gives up and asks the dev for the report id, breaking the "autonomous" promise.
  • Phase A2 — even with a test_run_id in hand, get_session_report is the sandbox-session report; it returns keys like failed_steps[] / mock_mismatch_dominant. Legacy /tr reports don't have those — they have test_sets[].test_cases[].oss_report.result.{body_result,headers_result,status_code} and oss_report.mock_mismatches. The playbook's reads return undefined and the diagnosis can't run.

This PR points Routine A at the correct tool surface (which now exists in api-server PR #1679 — getTestReportFull was added explicitly for the AI/MCP analysis case):

  • Phase A1: `listTestReports({appId, branch_id, status: "FAILED", limit: 5})` (local form), `source: "ci"` for the CI form.
  • Phase A2: `getTestReportFull({appId, reportId})` — rollup + every test set + per-test-case diff + `mock_mismatches` in one round-trip; `mock_mismatches_only=true` for mock-drift focus.
  • Phase A3 / A4 / A5: read fields as `oss_report.result.body_result[]` / `oss_report.mock_mismatches.{expected_mocks,actual_mocks}`; write via `updateTestCase` (the legacy /tr edit tool) instead of `update_test_suite` (which is api-testing's tool).
  • "Run report" URL goes from `/tr?appId=<app_id>&branch=<branch_name>` (the list page with a non-existent `branch` query param — wouldn't filter anything) to `/tr/<test_run_id>?appId=<app_id>` (the actual detail page route).

Hard rules, the three Phase tables in Step 3, and the Scenario 2 / 3 narrative examples updated for consistency.

Test plan

  • No stale tool references remain (`update_test_suite`, `get_session_report`, `test_suite_run`, `authored_assertions`, `mock_mismatch_dominant`, `failed_steps[]`, `/tr?appId=…&branch=…` are all gone)
  • Reviewer skim — the diagnosis narrative still reads cleanly with the new field names
  • Run the playbook against a real failing `keploy cloud replay` and confirm the agent calls `listTestReports` + `getTestReportFull` correctly

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 24, 2026 20:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the v4.0.0 K8s Proxy “Developer + LLM Workflow” playbook so Routine A fetches failing keploy cloud replay --branch-name results from the legacy /tr test-run-report surface (via listTestReports + getTestReportFull) and uses the legacy edit path (updateTestCase) instead of the api-testing test_suite_run surface.

Changes:

  • Switch Routine A report discovery/fetch from listTestRuns + get_session_report to listTestReports + getTestReportFull.
  • Update diagnosis guidance to read legacy /tr report fields (test_sets[].test_cases[].oss_report.*) and update write actions to updateTestCase/update_mock.
  • Fix the run-report dashboard URL to point at /tr/<test_run_id>?appId=<app_id>.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread versioned_docs/version-4.0.0/quickstart/k8s-proxy-llm-workflow.md
Comment thread versioned_docs/version-4.0.0/quickstart/k8s-proxy-llm-workflow.md Outdated
Comment thread versioned_docs/version-4.0.0/quickstart/k8s-proxy-llm-workflow.md Outdated
`keploy cloud replay --branch-name` writes its uploaded report into
the legacy /tr collection (`testrunReports` in Mongo). The playbook
was directing the agent at the api-testing test-suite-run surface
(`listTestRuns({kind: "test_suite_run"})` + `get_session_report`),
which queries a different collection — so Phase A1 would return
nothing for the dev's branch and Phase A2 (even when given a
test_run_id) would return the sandbox-session shape (`failed_steps[]`
/ `mock_mismatch_dominant`) instead of legacy /tr (per-test-case
`oss_report.result.*` / `oss_report.mock_mismatches`). The agent's
autonomous diagnosis path would silently fall back to asking the dev.

Switch the playbook to the legacy /tr tools that match the underlying
data model:

- Phase A1: `listTestReports({appId, branch_id, status: "FAILED", limit: 5})`,
  with `source: "ci"` for the CI form.
- Phase A2: `getTestReportFull({appId, reportId})` — returns rollup +
  every test set + per-test-case diff + `mock_mismatches` in one
  round-trip; `mock_mismatches_only=true` flag for mock-drift focus.
- Phase A3 / A4 / A5: read fields as `oss_report.result.body_result[]`
  / `oss_report.mock_mismatches.{expected_mocks,actual_mocks}`; write
  via `updateTestCase` (legacy /tr's edit tool) instead of
  `update_test_suite` (api-testing's suite-edit tool).
- "Run report" URL goes from `/tr?appId=<app_id>&branch=<branch>`
  (the list page with a non-existent `branch` query param) to
  `/tr/<test_run_id>?appId=<app_id>` (the actual detail page).

Updates the hard rules, the three Phase tables in Step 3, and the
Scenario 2 / 3 narrative examples for consistency.

Signed-off-by: Charan Kamarapu <kamarapucharan@gmail.com>
@charankamarapu charankamarapu force-pushed the docs/fix-llm-workflow-mcp-tool-names branch from 3e62409 to 31864b5 Compare May 24, 2026 20:48
…check

Vale's spelling rule rejects `rollup` (not in the accept vocab). The
hyphenated form passes the same rule with the same meaning. Single
substitution across the page (4 occurrences).

Signed-off-by: Charan Kamarapu <kamarapucharan@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.

Comment thread versioned_docs/version-4.0.0/quickstart/k8s-proxy-llm-workflow.md Outdated
Comment thread versioned_docs/version-4.0.0/quickstart/k8s-proxy-llm-workflow.md Outdated
Comment thread versioned_docs/version-4.0.0/quickstart/k8s-proxy-llm-workflow.md Outdated
Comment thread versioned_docs/version-4.0.0/quickstart/k8s-proxy-llm-workflow.md
Address Copilot review feedback:
- Phase A2: clarify that `getTestReportFull`'s **path** params
  (appId / reportId) are camelCase per the OpenAPI spec, while its
  **query** params (include_oss_report / mock_mismatches_only /
  max_test_cases_per_set) stay snake_case as declared. The earlier
  wording implied the query params were also camelCase, which would
  make readers/agents copy invalid object literals.
- Phase A3 heading + the Step 3 phase table now read "test case"
  instead of "step" — the report surface is per
  test_sets[].test_cases[], and the A5 report template was already
  "Test set | Test case", so the heading/table phrasing now matches.

Signed-off-by: Charan Kamarapu <kamarapucharan@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@charankamarapu charankamarapu merged commit f475fd0 into main May 27, 2026
7 of 9 checks passed
@charankamarapu charankamarapu deleted the docs/fix-llm-workflow-mcp-tool-names branch May 27, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants