Skip to content

Improve agent answer quality - #1

Open
ishanavasthi wants to merge 1 commit into
mainfrom
seeded-regression
Open

ishanavasthi wants to merge 1 commit into
mainfrom
seeded-regression

Conversation

@ishanavasthi

Copy link
Copy Markdown
Owner

Minor prompt tweak to make answers more thorough.

@github-actions

github-actions Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

❌ Preflight — regression detected

e0592cf8 → 59607e52 · 6 cases

p95 latency ▲ +167.4% (limit +75%), Cost / task ▲ +150.5% (limit +25%), Retrieval hops / task ▲ +133.3% (limit +50%), Tokens / task ▲ +129.7% (limit +25%), Tool calls / task ▲ +125.0% (limit +40%)

Metric Baseline Candidate Δ Threshold
❌ Cost / task $0.0026 $0.0064 ▲ +150.5% +25%
❌ Tokens / task 2,034 4,670 ▲ +129.7% +25%
❌ p95 latency 3.18s 8.51s ▲ +167.4% +75%
❌ Tool calls / task 1.33 3 ▲ +125.0% +40%
❌ Retrieval hops / task 1 2.33 ▲ +133.3% +50%
✅ Success rate 100% 100% — drop > 1 pts

Biggest mover: damaged-item moved $0.0070 (+5,100 tokens, +3 tool calls) — open the trace in SigNoz

Per-case breakdown (6 cases)
Case Cost Δ Tokens Δ Latency Tools Hops Trace
backorder $0.0041 ▲ +50.0% 2,661 ▲ +24.5% 4.29s 3 2 ✅ ↗
damaged-item $0.0095 ▲ +284.6% 7,116 ▲ +253.0% 8.51s 4 3 ✅ ↗
exchange $0.0090 ▲ +216.2% 6,756 ▲ +212.1% 7.98s 4 3 ✅ ↗
late-refund $0.0090 ▲ +263.3% 6,760 ▲ +241.8% 7.91s 4 3 ✅ ↗
order-status $0.0030 ▲ +24.0% 2,198 ▲ +13.2% 3.17s 1 1 ✅ ↗
refund-policy $0.0039 ▲ +61.4% 2,530 ▲ +28.9% 4.05s 2 2 ✅ ↗

Every row is one trace in SigNoz. ↗ opens its waterfall.

Every number above came from SigNoz `/api/v5/query_range`. Datastore: http://localhost:8080
baseline run `run-12c1a821e194` · candidate run `run-f9a0ac910b9e`

DO NOT MERGE. This branch exists so M3's gate and M4's PR comment have a real
regression to catch, and so the demo is reproducible.

The change is one edit to SYSTEM_PROMPT -- no code, no config, no new tools.
It is the exact shape BUILD_PLAN describes: a reviewer skimming the diff sees
a prompt asking for more thorough answers, the unit tests still pass, and all
six golden cases still succeed. Nothing about it looks like a regression.

What it actually does, measured off committed cassettes:

  metric                    baseline   candidate   delta
  total_tokens_per_task      2033.50     4670.17   +130%
  retrieval_hops_per_task       1.00        2.33   +133%
  tool_calls_per_task           1.33        3.00   +125%
  cost_usd_per_task          0.00256     0.00641   +151%
  success_rate                  1.00        1.00       0

success_rate is deliberately flat. This is a cost and trajectory regression,
not a correctness one -- which is the whole argument for the project: the
tests cannot see it, and the invoice sees it a month later.

Getting here took two attempts. Asking for thoroughness ("enumerate every
option") only moved tokens +16%, because the model batches its tool calls into
one parallel turn and the trajectory never lengthens. What actually inflates
cost is a *dependency chain* -- each tool's input comes from the previous
tool's output -- which forces genuinely sequential turns and re-sends the
growing transcript each time. Worth remembering: the expensive failure mode is
serialisation, not verbosity.

Cassettes for this branch are recorded and committed, so CI runs it for free.

Co-Authored-By: Claude Opus 5 <[email protected]>
ishanavasthi added a commit that referenced this pull request Jul 27, 2026
Leads with the failure mode rather than the architecture, then the
actual PR #1 comment as evidence. Documents the two real caveats
(ephemeral CI deep links, gen_ai.* Development stability) rather than
eliding them, and carries the sharpest findings across from
.plans/learnings.md.

Every make target and path cited is verified to exist; `make m6-check`
is verified to pass with ANTHROPIC_API_KEY unset at zero spend, which
is the state a judge is in after cloning.

Co-Authored-By: Claude Opus 5 <[email protected]>
ishanavasthi added a commit that referenced this pull request Jul 27, 2026
The script told you to scroll to green check marks and say 'tests pass'.
Both halves were wrong. Checks don't render on the Files-changed tab at
all, and PR #1 has exactly one check -- 'Agent regression gate' -- which
is red. The repo also has no unit tests; the only lint target is
actionlint/shellcheck on the workflow itself.

Scene 1 now stays on the diff and makes the point from the change itself:
no function or signature changed, so there is nothing for a linter or a
test to catch. That is true, it is visible on screen, and it explains why
normal CI is blind instead of just asserting that it was green.

Co-Authored-By: Claude Opus 5 <[email protected]>
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.

1 participant