fix(pr): pin agent-meta marker, add harness field
ci / nix (push) Successful in 10s
ci / lint (push) Failing after 12s

This commit is contained in:
Miguel Palhas
2026-08-26 10:34:52 +01:00
parent a229d0ce79
commit ca02107d42
3 changed files with 21 additions and 5 deletions
+6 -1
View File
@@ -92,7 +92,12 @@ Then **end the turn**. Do not wait for anything.
Each reason is one query. Nothing new: return silently, per Each reason is one query. Nothing new: return silently, per
`COMMON.md`. Update the state file whenever the phase or head SHA `COMMON.md`. Update the state file whenever the phase or head SHA
changes. Every body you post ends with the metadata marker from changes. Every body you post ends with the metadata marker from
`COMMON.md`. `COMMON.md`, verbatim — the `agent-meta` JSON object, never an
invented tag:
```
<!-- agent-meta: {"model":"<model-id>","harness":"<harness>","session":"<sid>"} -->
```
### `reason=comments` ### `reason=comments`
+10 -4
View File
@@ -8,9 +8,9 @@ when there is work, the skill decides what to do about it.
`bin/reviewer-poll.ts` runs as a systemd user service and is the only `bin/reviewer-poll.ts` runs as a systemd user service and is the only
thing polling a forge. It reads metadata — `updated_at`, `state`, thing polling a forge. It reads metadata — `updated_at`, `state`,
`draft`, `mergeable`, head SHA — and touches comment bodies in exactly `draft`, `mergeable`, head SHA. It never reads comment bodies, so the
one case: checking the metadata marker (below) to decide whether new metadata marker (below) is for local tooling only. When a PR looks
comments are the target session's own. When a PR looks changed it changed it
either creates a session for it or sends a one-line hint to the session either creates a session for it or sends a one-line hint to the session
that already owns it. that already owns it.
@@ -92,10 +92,16 @@ issue comment, reply — ends with a hidden marker as its last line,
after a blank line: after a blank line:
``` ```
<!-- agent-meta: {"model":"<model-id>","session":"<sid>"} --> <!-- agent-meta: {"model":"<model-id>","harness":"<harness>","session":"<sid>"} -->
``` ```
Post that marker verbatim — a JSON object with those keys. Do not
invent a different marker, and do not replace it with a bare tag like
`<!-- pr-daemon:land -->`; local tooling parses the JSON.
- `model`: the model id you are running as (e.g. `claude-fable-5`) - `model`: the model id you are running as (e.g. `claude-fable-5`)
- `harness`: the agent harness you run in — `claude-code`, `codex`,
`pi`, `opencode`
- `session`: first 8 chars of your harness's session id — - `session`: first 8 chars of your harness's session id —
`$CLAUDE_CODE_SESSION_ID`, `$PI_SESSION_ID`, or whatever your harness `$CLAUDE_CODE_SESSION_ID`, `$PI_SESSION_ID`, or whatever your harness
sets; omit only if none exists sets; omit only if none exists
+5
View File
@@ -122,6 +122,11 @@ this section exists to prevent.
End the review body and every `comments[]` body with the metadata End the review body and every `comments[]` body with the metadata
marker from `COMMON.md` (skip a review body that is otherwise empty). marker from `COMMON.md` (skip a review body that is otherwise empty).
Post it verbatim — the `agent-meta` JSON object, never an invented tag:
```
<!-- agent-meta: {"model":"<model-id>","harness":"<harness>","session":"<sid>"} -->
```
Only after the user's go-ahead on an unlisted repo. Record every id you post Only after the user's go-ahead on an unlisted repo. Record every id you post
in the same step, or the next hint reads your own review as new in the same step, or the next hint reads your own review as new