Skip to content

Default Codex replies to the message tool#75745

Closed
pashpashpash wants to merge 2 commits intomainfrom
codex/codex-message-tool-default
Closed

Default Codex replies to the message tool#75745
pashpashpash wants to merge 2 commits intomainfrom
codex/codex-message-tool-default

Conversation

@pashpashpash
Copy link
Copy Markdown
Contributor

Codex app-server turns already expose the OpenClaw message tool by default, and group/channel conversations already treat visible room output as something the agent should send deliberately through that tool. Direct chats were the odd case: even when the active runtime was Codex, OpenClaw would still automatically post the final assistant message unless messages.visibleReplies was configured globally.

This adds a small harness-level delivery default so runtimes can express that preference without core knowing about a specific plugin id. The Codex harness now opts into message-tool visible replies for source turns where the operator has not explicitly configured delivery. Existing explicit messages.visibleReplies settings, native command replies, and message-tool-unavailable fallback behavior still win.

The result is a cleaner Codex-mode path: the model can finish its turn privately, and channel-visible output is a deliberate message(action="send") call.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: codex size: S maintainer Maintainer-authored PR labels May 1, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 1, 2026

Codex review: needs changes before merge.

What this changes:

The PR adds an optional agent-harness visible-reply default, makes the Codex harness default direct source replies to the message tool when config is unset, updates dispatch/source-reply tests plus docs/changelog, and adjusts one gateway test logger mock.

Required change before merge:

A worker can safely make the narrow mechanical repair by regenerating and committing the Plugin SDK API baseline hash on the PR branch; maintainer review remains for the runtime delivery-default behavior itself.

Security review:

Security review cleared: The diff changes reply routing, docs, tests, changelog, and a typed SDK surface without adding dependencies, CI execution, secrets handling, downloaded artifacts, or broader permissions.

Review findings:

  • [P2] Regenerate the Plugin SDK API baseline — src/agents/harness/types.ts:43
Review details

Best possible solution:

Keep the additive harness-owned delivery default, regenerate and commit the Plugin SDK API baseline hash, then land after maintainer review and targeted Codex/direct-reply validation.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main shows direct source replies resolve to automatic delivery without global messages.visibleReplies, while the PR patch adds the harness-default path and tests the intended Codex direct-chat delivery behavior.

Is this the best way to solve the issue?

Mostly yes. A harness-level default is the narrow maintainable design because it avoids hard-coding Codex into core dispatch and preserves explicit config, native-command, and message-tool-unavailable precedence; the missing SDK baseline is the repair needed before merge.

Full review comments:

  • [P2] Regenerate the Plugin SDK API baseline — src/agents/harness/types.ts:43
    AgentHarness is re-exported through openclaw/plugin-sdk/agent-harness-runtime, so adding deliveryDefaults changes the public Plugin SDK API. The branch does not include docs/.generated/plugin-sdk-api-baseline.sha256, so the SDK API baseline check and release checks can report drift until the baseline is regenerated and committed.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.86

Acceptance criteria:

  • pnpm plugin-sdk:api:check
  • pnpm test src/auto-reply/reply/source-reply-delivery-mode.test.ts src/auto-reply/reply/dispatch-from-config.test.ts extensions/codex/index.test.ts
  • pnpm check:changed

What I checked:

Likely related people:

  • steipete: Recent commits on source reply delivery, dispatch fallback, visible-reply docs, and Codex harness docs make this the strongest routing owner for the default-delivery behavior. (role: recent maintainer; confidence: high; commits: 1c300cec5d80, 8989ceee50ab, 42aaf0c98a7c; files: src/auto-reply/reply/dispatch-from-config.ts, src/auto-reply/reply/source-reply-delivery-mode.ts, docs/plugins/codex-harness.md)
  • pashpashpash: Beyond authoring this PR, prior merged work on current main touched Codex app-server isolation, diagnostics routing, and harness auth/profile behavior. (role: adjacent harness owner; confidence: high; commits: 027ea5f08bd9, 6ce1058296cc, 78d51dcebe9e; files: docs/plugins/codex-harness.md, extensions/codex/harness.ts, extensions/codex/src/app-server)
  • 100yenadmin: A prior merged commit added Codex harness extension seams touching src/agents/harness/types.ts, the same public type surface this PR extends. (role: introduced adjacent SDK seam; confidence: medium; commits: c13836804058; files: src/agents/harness/types.ts)

Remaining risk / open question:

  • The behavior change affects default visible delivery for Codex direct chats, so maintainer review is still needed even after the mechanical baseline fix.
  • Exact-head CI is not fully green yet; the observed check-test-types failure is outside the PR diff but still needs resolution or a passing rerun before merge.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 53593f0683fa.

@pashpashpash
Copy link
Copy Markdown
Contributor Author

Closing this in favor of #75765.

The useful behavior from this PR has been folded into the replacement branch: Codex harness direct/source replies now default to the OpenClaw message tool when messages.visibleReplies is unset, while explicit config still wins. #75765 also carries the structured heartbeat response tool work, the live Telegram heartbeat evidence, the SDK baseline update for the new harness delivery-default contract, and the CI fixes needed for the combined change.

Keeping the default-reply behavior and heartbeat tool work in one PR avoids two overlapping changes to Codex harness delivery semantics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: codex gateway Gateway runtime maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant