Skip to content

fix(opencode-claimant): post the launch agent-note via gh (#6257) - #6271

Merged
dezren39 merged 1 commit into
mainfrom
fix/claimant-agent-note
Nov 5, 2026
Merged

dezren39 merged 1 commit into
mainfrom
fix/claimant-agent-note

Conversation

@dezren39

@dezren39 dezren39 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Fourth step of the #6257 binding-rate fix. The launches themselves worked after #6263/#6268/#6270 (26 tasks bound across three verification fires), but every launch recorded a spurious "agent note failed": post_agent_note shelled to repo-queue signal --worker ... --kind agent-note:v1. signal is the queue-poke verb (bundle continuation), rejects --worker in that position, and was never a note path.

The note is prompt.md step 4e: a gh comment on the task issue/PR carrying the agent-note:v1 marker - the format the ad-hoc launch driver used for the first 29 binds. Now: ref parsed from the task dedupe key tail (issue:N / pr:N), repo resolved from the queue, posted via gh issue/pr comment with the note file written under the claimant state dir (same as the driver). No ref = quiet no-op, not a failure.

poll.py + claimant.py candidate records now carry dedupe_key + title (the note needs them; progress.issue_number, the previous source, is never set by handoffs and was always null).

Proven live before merge: a verification fire launched 9 tasks with zero note failures; note-10460.md written by the patched code and the matching agent-note:v1 comment with the exact bound session id read back from issue #6164 via the API.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • New Features
    • Agent notes are now posted as comments on the GitHub issue or pull request linked to a task. Comments include a timestamp and task context.
  • Bug Fixes
    • Tasks without a usable issue or pull request reference are handled without triggering a posting error. Failures when posting a comment are still reported.

…ueue signal

Every launch in the first live fires recorded a spurious
agent-note failure: post_agent_note shelled to
repo-queue signal --worker opencode-claimant --kind agent-note:v1,
but signal is the queue-poke verb and rejects --worker - it was
never a note path.

The note is prompt.md step 4e: a gh comment on the tasks issue/PR
carrying the agent-note:v1 marker (the format the launch driver
used for the first 29 binds). post_agent_note now parses the ref
from the task dedupe key, resolves the repo from the queue, and
posts via gh issue/pr comment; a task with no ref is a quiet
no-op. poll.py and claimant.pys candidate records now carry
dedupe_key + title so the ref survives discovery (previously only
progress.issue_number, which handoffs never set - always null).
@dezren39
dezren39 requested a review from a team as a code owner November 5, 2026 16:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T16:02:16.116761Z 95dd49e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

Candidate records now include task deduplication keys and titles. The claimant uses this metadata to identify a GitHub issue or pull request, format a timestamped agent note, and post it through the GitHub CLI.

Changes: GitHub Agent Notes

Layer / File(s) Summary
Carry task metadata to candidates
pm-stack/opencode-claimant/poll.py, pm-stack/opencode-claimant/claimant.py
Candidate outputs now include each claimed task’s dedupe_key and title.
Post notes to GitHub
pm-stack/opencode-claimant/claimant.py
launch_candidate passes task metadata to post_agent_note. The function maps queues to repositories, parses issue or pull request references, formats timestamped notes, and invokes the corresponding GitHub CLI command. Missing references or repository mappings produce successful no-ops. Posting errors produce a failure result.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant launch_candidate
  participant post_agent_note
  participant GitHubCLI
  participant GitHub
  launch_candidate->>post_agent_note: task ID, session ID, queue, dedupe key, title
  post_agent_note->>GitHubCLI: issue or pull request comment command
  GitHubCLI->>GitHub: post timestamped agent note
Loading

Possibly related PRs

  • developing-today/code#3143: Its retry dedupe-key suffix can place the issue reference before the final segment, while this change parses references from dedupe keys.
Merge Risk: Low · up to 95dd4

Agent notes can target the wrong repository when a supplied dedupe key disagrees with the task queue. Normal canonical keys are unaffected; merging carries a bounded note-delivery risk unless repository consistency is checked.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit 00a294a into main Nov 5, 2026
1 check failed
@dezren39
dezren39 deleted the fix/claimant-agent-note branch November 5, 2026 16:03
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