Skip to content

🤖 refactor: support incremental subagent reports#3714

Open
ammar-agent wants to merge 15 commits into
mainfrom
refactor/incremental-subagent-reports
Open

🤖 refactor: support incremental subagent reports#3714
ammar-agent wants to merge 15 commits into
mainfrom
refactor/incremental-subagent-reports

Conversation

@ammar-agent

Copy link
Copy Markdown
Collaborator

Summary

Refactors sub-agent reporting so agent_report is a repeatable incremental update channel that immediately wakes the parent, while the sub-agent's final assistant message is the terminal task result.

Background

agent_report previously doubled as both the only parent notification mechanism and the required terminal completion tool. That made it impossible for review and other long-running sub-agents to surface findings before they were done, and it forced a tool-only final response.

Implementation

  • enables agent_report for non-plan sub-agents without requiring it or stopping generation
  • publishes each successful call directly to the parent as an in_progress sub-agent report, with per-tool-call queue deduplication
  • allows repeated updates, including while descendant tasks are still active
  • finalizes ordinary sub-agent tasks from a clean final assistant response instead of the tool call
  • combines a workflow agent's final assistant prose with the latest valid structured agent_report, including updates from earlier turns
  • preserves legacy in-flight completion compatibility and existing plan-agent propose_plan behavior
  • updates recovery/timeout prompts, built-in agent and skill guidance, docs, and UI terminology

Validation

  • bun test src/node/services/tools/agent_report.test.ts src/node/services/taskService.test.ts
  • targeted task-await, stream manager, workflow runner, and tool-policy tests
  • bun run typecheck
  • make static-check

Risks

Moderate orchestration risk: this changes the task completion boundary and parent wake-up path. Coverage includes repeated updates, cross-turn structured workflow metadata, recovery prompts, legacy stream compatibility, task cleanup, and the full static-check suite.


Generated with mux • Model: openai:gpt-5.6-sol • Thinking: high • Cost: $32.45

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

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

ℹ️ 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 src/node/services/taskService.ts
@mintlify

mintlify Bot commented Jul 12, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Mux 🟢 Ready View Preview Jul 12, 2026, 3:32 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Fixed the failed Unit check by updating the WorkflowRunner timeout expectation to the new final-response contract. Local WorkflowRunner.test.ts and make static-check pass.

@codex review

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Addressed Codex P2 finding PRRT_kwDOPxxmWM6QKq7B: workflow-owned agent_report calls now remain internal schema handoffs and do not queue/wake the parent. Added a regression test proving the workflow child stays running and the parent receives no message.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the workflow-owned progress wake-up finding in d5778d1 and added regression coverage.

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

ℹ️ 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 src/node/services/taskService.ts Outdated
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the missing-finishReason finalization issue and added explicit clean-stop coverage. TaskService tests and static-check pass.

@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: 12017524be

ℹ️ 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 src/node/services/taskService.ts
Comment thread src/node/services/agentDefinitions/resolveToolPolicy.ts
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed both P1 findings: best-of dedupe now ignores incremental reports, and legacy inherited agent_report requirements are removed for non-plan subagents. Focused tests and static-check pass.

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

ℹ️ 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 src/node/services/taskService.ts Outdated
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the report-envelope parsing finding with regression coverage. TaskService tests and static-check pass.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the report-status parsing finding with top-level envelope parsing and regression coverage. TaskService tests and static-check pass.

@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: 1836745ce2

ℹ️ 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 src/node/services/taskService.ts Outdated
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

The failed Integration job was a flaky timeout in tests/ui/chat/sendModeDropdown.test.ts; the targeted test passes locally (4/4). Re-running the failed CI job.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed legacy invalid workflow schema recovery. Focused TaskService tests and static-check pass; the flaky Integration rerun is also in progress.

@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: 4a35aeff90

ℹ️ 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 src/node/services/taskService.ts Outdated
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed stale structured-output reuse after failed final updates. Focused TaskService tests and static-check pass.

@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: 2ea2730879

ℹ️ 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 src/node/services/taskService.ts Outdated
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed history scanning past failed workflow reports. Focused TaskService tests and static-check pass.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed history scanning past failed workflow updates. Focused TaskService tests and static-check pass.

@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: 5a8c7a0d77

ℹ️ 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 src/node/services/taskService.ts Outdated
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed stale in-turn structured output after a failed newer update. Focused TaskService tests and static-check pass.

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

ℹ️ 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 src/node/services/taskService.ts Outdated
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed corrected-report ordering semantics. Focused TaskService tests and static-check pass.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed ordering for corrected agent_report retries. Focused TaskService tests and static-check pass.

@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: 201dc56fec

ℹ️ 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 src/node/services/taskService.ts
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed queued progress ordering by selectively superseding pending incremental updates when the terminal report arrives. Focused queue/TaskService tests, typecheck, and static-check pass.

@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: 0553eece26

ℹ️ 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 src/node/services/messageQueue.ts Outdated
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed sibling queued-update preservation by isolating dedupe-keyed queue entries. Focused queue/TaskService tests, typecheck, and static-check pass.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed sibling progress preservation by isolating dedupe-keyed queue entries. Focused queue/TaskService tests, typecheck, and static-check pass.

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

ℹ️ 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 src/node/services/agentSession.ts Outdated
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed callback-free queue removal detection and notification state. Focused queue/TaskService tests, typecheck, and static-check pass.

@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: 0199632c04

ℹ️ 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 src/node/services/messageQueue.ts
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed pre-batch isolation for removable progress updates. Focused tests, typecheck, and static-check pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 897b0c1029

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

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