Skip to content

fix(delegation): correct the T3 Wait procedure and accept ADR-0028 - #273

Merged
furedea merged 4 commits into
mainfrom
fix/t3-wait-procedure
Nov 21, 2026
Merged

furedea merged 4 commits into
mainfrom
fix/t3-wait-procedure

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

概要

変更前後

項目 変更前 変更後
承認待ちの検出 pendingRequestCount > 0(status は waiting と記載) pendingRequestCount > 0 のみ.status は running のまま
ターン終了 activeRunId が null かつ status が idle/completed 同じ.waiting(awaited な背景作業が完了を保持)は稼働中扱い.pendingBackgroundTasks は規則に使わない(isAwaitedWork,threadStatus)
Prompt 直後 古い run の完了状態と返信を新しい返信と誤読しうる send 前に latestRunId を記録し,変わるまで失敗・取消を含むどの終了判定もしない.3 回ポーリングしても変わらなければ「新しい run が始まらなかった」と報告.send が非 0 ならユーザーに報告
返信の読み取り --messages 1 --messages 5.role: assistant かつ runId == latestRunId の最後のメッセージ.無ければ --messages を増やして再読
ADR-0028 proposed accepted(amended に根拠と,--wait ではなく show のポーリングで待つ旨の 2 行.本文は不変)

検証

  • adr-check --base origin/main docs/adr: 通過
  • dprint check(t3.md,ADR-0028): 差分なし(他 ADR の指摘は既存でこの変更の対象外)
  • ls_lint: 通過
  • uv run pytest -q -k "skill or delegation or adr": 131 passed
  • CI(all-green)とレビュー: 本 PR で確認

Limits

  • ドキュメントのみの変更.SKILL.md,branches.md,guard / hooks,Herdr は対象外.
  • ADR-0028 は front matter(status,amended 2 項目)に加え,本文の 2 か所(Decision Outcome の --wait の文と,無タイムアウトの Consequence)へ「2026-11-22 に改訂し,親は t3 thread show をポーリングする」旨の注記を足した(033aa239,親の承認済み).注記以外の本文は変更していない.adr-check --base origin/main は通る(origin/main では proposed なので本文の変更検査の対象外).
  • 最終ラウンドの未対応の指摘(直さず記録のみ):
    • ADR-0028 の Consequence の注記行が他の行の折り返し幅(120 桁)を超える(P2).
    • ADR の注記は「ポーリングが --wait の無タイムアウトの懸念を置き換える」と書くが,t3.md の上限は「新しい run が始まらない」場合の 3 回だけで,run 開始後の running や waiting は無期限にポーリングされる(P3).「軽減する」に直すか,N 回で報告する規則を足す余地がある.
    • t3.md は完了を保持しない背景作業の kind を shell と書いたが,codex-review は T3 0.1.10 の実際の kind は command と monitor だと指摘している(P3).shell は command に直す余地がある.
  • 背景作業の扱いは T3 0.1.10 の isAwaitedWork(orchestration-v2/RestartBackgroundNote.ts)と threadStatus(OrchestratorMcpService.ts)に基づく.
  • pendingBackgroundTasks などのフィールドは T3 0.1.10 サーバーのソース(source map)の読解に基づく.
Scope と根拠

Refs #264

🤖 Generated with Claude Code

Detect an approval wait by pendingRequestCount, not status, treat waiting
or pending background tasks as still working, guard a Prompt against the
previous run's reply with latestRunId, and read more than one message.
ADR-0028 is accepted after the first real lane (PR #272).

Refs #264

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 21, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T19:43:28.126669Z 033aa23 Manual request
ℹ️ 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.

@github-actions

Copy link
Copy Markdown

Review summary: no findings.

The change is docs-only (t3.md Wait/Prompt/Read, plus the ADR-0028 front matter). I read it for correctness of the new procedure and found no defects.

  • The decision order (failure, then approval pending, then turn ended, then still working) is consistent. A pending request leaves status as running, so checking pendingRequestCount before the end-of-turn test is correct.
  • Recording latestRunId before send closes the stale-reply window. Requiring runId == latestRunId and re-reading with a larger --messages avoids reporting an older message as the reply.
  • No tests cover this behavior. They would not be meaningful for a prose procedure, and the PR reports the doc, ADR, and lint checks as passing.

I did not run the checks myself. The pendingBackgroundTasks semantics rest on the source-map reading that the PR's Limits section already discloses.

🤖 Generated with Claude Code

@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: 55167b23ba

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

…waiting with --wait

Refs #264

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 21, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary

This PR only changes docs: t3.md and the ADR-0028 front matter. I found no P0 or P1 problems. The new Wait order (failure, then approval, then ended, then running) and the latestRunId recorded before send fix the stale-reply problem the PR describes.

  • P2 (t3.md): the failure check runs before the latestRunId guard. After a Prompt, a stale terminal status from the previous run can be reported as a new failure. A Prompt that never starts a run also has no bound on polling.
  • P3 (ADR-0028): the ADR is now accepted, but its body still says the parent waits with --wait, and the new amended entry says it doesn't. Both amended entries are dated one day after the ADR's date.

No tests were added. That is reasonable for a procedure document, but nothing checks the new wording.

🤖 Generated with Claude Code

@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: 7ffc1af7e7

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

…iting for held completion

Refs #264

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 21, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary (docs-only change)

No P0 or P1 findings. The Wait procedure in t3.md is internally consistent. The stale-run guard comes first, then failure, then pending approval, then turn end, then still working. Recording latestRunId before send closes the stale-reply race the PR describes.

  • P3 (inline, ADR-0028): the amended note says --wait is no longer used, but the Decision Outcome and Consequences in the ADR body still describe --wait. The amended dates (2026-11-22) are also one day after the ADR date and the run date.
  • Not blocking, worth knowing: the PR description says pendingBackgroundTasks is part of the end-of-turn rule. t3.md instead says it is no part of the rule and uses awaited work and waiting status. The doc is the version to trust, but the description is out of date.
  • Not blocking, worth knowing: the "stop after the third poll" rule assumes send always starts a new run. If send to a still-active thread is folded into the current run, latestRunId would not change and the parent would report "did not start" wrongly. This is probably fine for the LANE-BLOCKED use case, where the previous run has ended.

I did not run anything beyond reading the diff. The PR description's checks (adr-check, dprint, pytest) are not re-verified here.

@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: c42118d2ac

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

Refs #264

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 21, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary

Docs-only change. I found no correctness or security problems in the revised Wait/Prompt procedure in t3.md. The decision order is consistent, and the stale-run guard using latestRunId closes the old-run misread.

Findings (2 inline comments):

  • P2: The ADR-0028 body is edited with inline "amended" text. This contradicts the PR description ("本文は変更しない", front matter only) and the ADR immutability rule.
  • P3: The amendment says polling "replaces" the no-timeout concern. After a run starts, the Wait loop is still unbounded.

No tests apply, since the change is documentation only. I did not run the checks myself and relied on the PR's reported results.

🤖 Generated with Claude Code

@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: 033aa2392f

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

@furedea
furedea merged commit 85a459a into main Nov 21, 2026
29 checks passed
@furedea
furedea deleted the fix/t3-wait-procedure branch November 21, 2026 20:22
furedea pushed a commit that referenced this pull request Nov 21, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.5.1](v0.5.0...v0.5.1)
(2026-11-21)


### Bug Fixes

* **delegation:** correct the T3 Wait procedure and accept ADR-0028
([#273](#273))
([85a459a](85a459a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: furedea-release[bot] <353651101+furedea-release[bot]@users.noreply.github.com>
furedea added a commit to furedea/dotfiles that referenced this pull request Nov 21, 2026
agent-config を 0.5.1 に上げる.T3 で lane を回す手順の修正(待ち方,transport の優先順位,Start
前の branch 確認)と ADR-0028 の accepted が入る.

| 入力 | 変更前 | 変更後 |
| --- | --- | --- |
| `agent-config` | `7e350e03`(v0.5.0) | `7f39859b`(v0.5.1) |

- [ ] CI
- [ ] 反映後,`delegation` skill の `references/t3.md` が新しい Wait 手順(`show` の
polling,`latestRunId` の確認)になっている

<details>
<summary>内容と出典</summary>

- furedea/agent-config#272:利用者が明示した transport を T3 より先に見る,Start 前に
branch の有無を確かめる,失敗の原因は `server.trace.ndjson` で調べる
- furedea/agent-config#273:Wait 手順の修正(承認待ちは `pendingRequestCount`,終了は
`status`,Prompt 後は `latestRunId` の変化を待つ),ADR-0028 を accepted
- 変更は `flake.lock` のみ.agent-harness は `follows` で変わらない
- 反映は #490(T3 server の常駐)と同じ `darwin-rebuild switch` で行う.その前に mbp の
desktop app で Local environment をオフにする(#489 の plan 手順 3)

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: furedea <132188853+furedea@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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