Skip to content

Keep nested agents waiting on their results; define one payload digest - #128

Merged
chrisbanes merged 6 commits into
mainfrom
cb/chrisbanes-skills-issues-1a2c19
Oct 19, 2026
Merged

chrisbanes merged 6 commits into
mainfrom
cb/chrisbanes-skills-issues-1a2c19

Conversation

@chrisbanes

Copy link
Copy Markdown
Owner

Two problems from a real run-github-project drain --auto-merge run on chrisbanes/haze (2026-10-18).

Nested owners handed back before their reviewer reported

Claude Code ticket owners for haze #1584 and #1585 launched their independent reviewer in the background, ended their turn and returned "review pending" with no push. The reviewer's verdict went to the controller, which had to relay it and resume the owner, and one owner did it twice.

Root cause: the shared subagent-selection.md said "Run workers in the background and wait for the completion notification". That only works for the top-level session, because a subagent receives no completion notifications, and Claude Code's Agent tool already defaults to the background. In addition, Project handoff allowed returning pending without limiting it to remote gates.

Changes:

  • references/subagent-selection.md, synced into its five skill copies: background launches are for the top-level session only. A subagent passes run_in_background: false for agents whose result it needs, and puts independent launches in one message so they still run in parallel.
  • deliver-spec/references/project-handoff.md: pending names only remote or controller-owned gates; never return while your own reviewer or helper is still running.
  • The Wayfinder research provider now runs in a "separate" rather than "background" subagent.

The top-level controller's background launches (ticket owners, watcher relay, repair-gate evidence helper) are unchanged.

Ambiguous plan-comment payload digest

For haze #1570, the planner hashed the comment body without its trailing newline and the controller hashed the raw API body, so the values differed. Common tools disagree too: jq -r and jq -j give different digests for the same body. The skills described the "payload" in three inconsistent ways and never said which bytes to hash. That also affects rank_tickets.py, which compares a plan digest with a replan report's previousPlanDigest by exact string.

Changes:

  • to-plan/references/github-mode.md gains a ### Payload digest section:

    • Start from the decoded API body and convert CRLF to LF.
    • For a plan comment, keep only the text from ## Implementation plan on, without a final </details> line. Other markers keep their whole body.
    • Strip trailing newlines, then record the SHA-256 as bare lowercase hex.

    It includes a worked example.

  • The superseded-wrapper fallback now places the wrapper where that rule expects it.

  • Every plan and runner-marker digest mention (authority pause/resume, parked/resume-parked, configuration renewal, Wayfinder renewal, replan chain, amendment pinning) now links to that section. The sha256: placeholders for payload digests are replaced.

Evals and tests

  • Six calibration cases, a direct/novel/restraint set per fix. Calibration-only, so the benchmark is unchanged; the count goes from 102 to 108.
  • test_to_plan_contract.py: a reference implementation of the digest rule. It checks the doc's worked example, that tool-newline, CRLF and wrapper variants agree, and that the case fixtures carry the expected digests.
  • test_workflows_writing_matrix.py: accepted, missing, unsafe and contradictory field variants for each new case.

Validation: npm run build, npm run lint, npm run evals:validate (212 cases) and npm test pass. No live model evals were run. The new cases grade written decision artifacts, so they don't prove live nested-agent behaviour. Also note that the eval harness sets CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1, which may hide the reviewer bug in live runs.

No version bump.

Delegated Claude Code owners launched their independent reviewer in the
background, ended their turn and handed back "review pending", so the
verdict reached the controller instead. The shared subagent reference now
limits background launches to the top-level session and tells a subagent
to pass `run_in_background: false` for agents whose result it needs,
batching independent launches to stay parallel. Project handoff no longer
treats a running reviewer or helper as `pending`, and the Wayfinder
research provider runs in a separate rather than background subagent.

Planners and controllers hashed different bytes for the same plan comment
because no reference defined the payload digest. to-plan's GitHub mode now
defines it once (decoded body, CRLF to LF, plan payload from
`## Implementation plan`, trailing newlines stripped, bare lowercase hex
SHA-256) with a worked example, and every plan and runner-marker digest
mention links to it.

Add a direct, novel and restraint calibration triad for each fix, plus
tests for the digest rule, its worked example and the case fixtures.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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-10-19T16:45:22.716941Z 4f7854b New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 051a6a7fc0

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/run-github-project/references/normalized-ticket.md Outdated
Comment thread skills/to-plan/references/github-mode.md Outdated
The payload digest rule removed "a final `</details>` line" before
stripping trailing newlines, so a wrapped body ending in a newline kept
its closing tag when the steps were followed literally. It now removes the
last nonempty line when it is `</details>`.

Records published before the rule may carry a different digest of the
same comment, and the ranker compares plan and replan-report digests
exactly. A verified pre-rule digest of the decoded body, raw or with
trailing newlines stripped and with or without a `sha256:` prefix, is now
accepted as a legacy identity and normalized to the rule's digest. Any
other mismatch still blocks. Published amendment chains keep the plan
digest they pinned.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7dab93b1ed

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/to-plan/references/github-mode.md Outdated
@greptile-apps

greptile-apps Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new blocking issue was found.

Summary

The PR separates top-level background launches from nested agents that must wait, and defines one shared payload-digest rule.

  • Subagents wait for the agents they need before handing work back.
  • Plan comments and runner markers use one reproducible payload digest.

Reviews (5) · Last reviewed commit: "Skip the wrapper fallback for legacy-nam..." · Reviewed by Greptile

Comment thread skills/to-plan/references/github-mode.md
Comment thread skills/to-plan/references/github-mode.md Outdated
Wayfinder reconciliation digests were defined to exclude a presentation
wrapper, but the payload digest rule kept every non-plan marker's whole
body, so a wrapped marker would hash differently from its pinned digest.
The rule now drops lines before the payload's first line (the plan
heading, or the marker line for runner markers) and removes the closing
`</details>` only when a dropped line opened the wrapper. A plan payload's
own trailing `<details>` block is no longer mistaken for a wrapper, and the
legacy path also accepts the wrapper-stripped form.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2047637246

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/to-plan/references/github-mode.md Outdated
Fast-path revisions publish the plan marker with a `## Fast path`
heading, so the payload digest rule had no starting line for them. The
rule now starts a plan payload at `## Implementation plan` or
`## Fast path`, treats a plan comment with neither as a blocker, and the
fast-path publication step names that heading level.

The rule also dropped the last nonempty line of a wrapped comment without
checking it, so text appended after a missing closer could reproduce an
unmodified digest. The last line must now be `</details>`; otherwise the
comment is a blocker.

Add tests for the fast-path shape, the missing closer, and the pre-rule
extracted payload with its trailing newline, which the legacy path
already accepts.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6cc70b63f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/to-plan/references/github-mode.md Outdated
The minimization fallback placed the wrapper before a predecessor's
`## Implementation plan` line, which a `## Fast path` revision lacks.
Both the to-plan and Project controller fallbacks now place it before the
first payload line the digest rule defines.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 46dba9b17b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/to-plan/references/github-mode.md
A pre-rule replan report can name its predecessor plan by a raw-body
digest. Wrapping that predecessor when native minimization fails changes
the body, so no legacy form can verify the report and the ranker blocks
the chain. Both wrapper fallbacks now skip the edit in that case and
report it as the existing presentation hygiene failure; the chain stays
authoritative. A regression test pins why the wrapped body cannot match.
@chrisbanes
chrisbanes merged commit c1b20be into main Oct 19, 2026
2 checks passed
@chrisbanes
chrisbanes deleted the cb/chrisbanes-skills-issues-1a2c19 branch October 19, 2026 17:37
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