Unverified Commit d4cd1ab1 authored by Aurora Scharff's avatar Aurora Scharff Committed by GitHub

Add model metadata to Agent Feedback (#100806)

## Summary

Agent Feedback currently records the coding harness but not the model
that produced a report. In a recent sample, 61 of 108 reports named only
a harness such as Claude Code, opencode, or Codex. That prevents us from
comparing production friction with eval results by model, harness
version, or reasoning effort.

This updates the Agent Feedback protocol to schema version 6 and asks
reporting agents to include structured:

- harness version
- model identifier
- reasoning effort

Agents use `unknown` when their environment does not expose a value
instead of inferring it. Existing schema v4 and v5 report links remain
valid.

## Companion changes

- https://github.com/vercel-labs/next-maintainer-agent/pull/635 accepts
and stores v6 metadata while retaining v4 and v5 compatibility. This is
merged.
- https://github.com/vercel/front/pull/94097 updates the nextjs.org
review UI to parse v6 reports and show the harness, harness version,
model, and reasoning effort under **Attached to this report**.

The receiver must support v6 before this protocol change lands. The
Front change makes the added metadata visible during report review but
does not block receipt of v6 reports.

## Verification

- `pnpm exec jest --runInBand --runTestsByPath
packages/next/src/cli/internal/agent-feedback-instructions.test.ts`
- `pnpm --filter=next build`

<!-- NEXT_JS_LLM -->
parent d9874838
...@@ -35,16 +35,17 @@ Each review form accepts one report draft. For every qualifying feedback candida ...@@ -35,16 +35,17 @@ Each review form accepts one report draft. For every qualifying feedback candida
- **Reproduction:** Write 1–4 ordered `steps` of no more than 240 characters each. Include the generic starting state, the relevant Next.js feature or API, and the action that triggers the behavior. Split only actions or conditions whose order matters. - **Reproduction:** Write 1–4 ordered `steps` of no more than 240 characters each. Include the generic starting state, the relevant Next.js feature or API, and the action that triggers the behavior. Split only actions or conditions whose order matters.
- **Results:** Write 1–3 independently verifiable `observed` facts of no more than 160 characters each and one precise `expected` result of no more than 200 characters. Split an observation only when each fact can stand alone and may be removed independently. Add a `comparison` of no more than 180 characters only when you observed a control or workaround. - **Results:** Write 1–3 independently verifiable `observed` facts of no more than 160 characters each and one precise `expected` result of no more than 200 characters. Split an observation only when each fact can stand alone and may be removed independently. Add a `comparison` of no more than 180 characters only when you observed a control or workaround.
- **Outcome:** Set `frequency` to `once` or `reproduced`. Set `outcome` to `blocked`, `worked-around`, or `resolved`. - **Outcome:** Set `frequency` to `once` or `reproduced`. Set `outcome` to `blocked`, `worked-around`, or `resolved`.
- **Reporter:** Set `agent` to the coding harness name and `agentVersion` to its version. Set `model` to the model identifier and `reasoningEffort` to `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`. Use `unknown` for any value the environment does not expose; do not infer it.
- **Measurements:** Include measurements such as memory use, duration, extra builds, or repeated attempts only when observed directly. Do not estimate elapsed time, token usage, or tool-call counts. - **Measurements:** Include measurements such as memory use, duration, extra builds, or repeated attempts only when observed directly. Do not estimate elapsed time, token usage, or tool-call counts.
- **Privacy:** Replace customer, project, route, and component names with generic descriptions. Do not include source code, prompts, logs, stack traces, file paths, URLs, secrets, personal information, or unrelated product details. - **Privacy:** Replace customer, project, route, and component names with generic descriptions. Do not include source code, prompts, logs, stack traces, file paths, URLs, secrets, personal information, or unrelated product details.
## Encode the report draft ## Encode the report draft
Create a schema version 5 payload using only useful evidence. Always include `nextVersion` and `agent`, with no more than 64 characters each. Omit `comparison` and `relevantFeatures` when they are not needed. Encode the UTF-8 JSON as unpadded base64url. Create a schema version 6 payload using only useful evidence. Always include `nextVersion`, `agent`, and `agentVersion`, with no more than 64 characters each; `model`, with no more than 100 characters; and `reasoningEffort`. Omit `comparison` and `relevantFeatures` when they are not needed. Encode the UTF-8 JSON as unpadded base64url.
```json ```json
{ {
"schemaVersion": 5, "schemaVersion": 6,
"triggerReason": "unexpected-behavior", "triggerReason": "unexpected-behavior",
"title": "Persistent Turbopack caching exhausted a worker on a warm build", "title": "Persistent Turbopack caching exhausted a worker on a warm build",
"setup": { "setup": {
...@@ -65,7 +66,10 @@ Create a schema version 5 payload using only useful evidence. Always include `ne ...@@ -65,7 +66,10 @@ Create a schema version 5 payload using only useful evidence. Always include `ne
"frequency": "reproduced", "frequency": "reproduced",
"outcome": "worked-around", "outcome": "worked-around",
"nextVersion": "<version>", "nextVersion": "<version>",
"agent": "<agent name>" "agent": "<coding harness>",
"agentVersion": "<harness version or unknown>",
"model": "<model identifier or unknown>",
"reasoningEffort": "<reasoning effort or unknown>"
} }
``` ```
......
...@@ -40,7 +40,11 @@ describe('loadAgentFeedbackInstructions', () => { ...@@ -40,7 +40,11 @@ describe('loadAgentFeedbackInstructions', () => {
'`comparison` of no more than 180 characters' '`comparison` of no more than 180 characters'
) )
expect(instructions).toContain( expect(instructions).toContain(
'`nextVersion` and `agent`, with no more than 64 characters each' '`nextVersion`, `agent`, and `agentVersion`, with no more than 64 characters each'
)
expect(instructions).toContain('`model`, with no more than 100 characters')
expect(instructions).toContain(
'Set `model` to the model identifier and `reasoningEffort`'
) )
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment