Skip to content

[codex] Add delivery NO_REPLY runtime contracts#71039

Closed
100yenadmin wants to merge 3 commits intoopenclaw:mainfrom
electricsheephq:contract-first/delivery-no-reply-runtime-contracts
Closed

[codex] Add delivery NO_REPLY runtime contracts#71039
100yenadmin wants to merge 3 commits intoopenclaw:mainfrom
electricsheephq:contract-first/delivery-no-reply-runtime-contracts

Conversation

@100yenadmin
Copy link
Copy Markdown
Contributor

@100yenadmin 100yenadmin commented Apr 24, 2026

Summary

Adds the delivery/NO_REPLY contract rung from RFC #71004. This is test-only: it locks currently-green follow-up delivery behavior for silent replies, dispatcher fallback, and Codex app-server preservation of silent terminal text. It also documents one known JSON-envelope delivery gap as a TODO for the later runtime-plan delivery migration.

No production delivery behavior changes in this PR.

flowchart TD
  Outcome["Agent payloads"] --> Delivery["OpenClaw delivery policy"]
  Delivery --> Silent["Exact/whitespace NO_REPLY suppresses visible delivery"]
  Delivery --> Media["NO_REPLY + media remains deliverable"]
  Delivery --> Dispatcher["Missing origin route falls back to dispatcher"]
  Delivery --> Todo["TODO: JSON NO_REPLY envelope suppression"]
  Codex["Codex app-server adapter"] --> Outcome
Loading

Files Changed And Why

File Purpose
test/helpers/agents/delivery-no-reply-runtime-contract.ts Shared NO_REPLY and delivery fixture data.
src/auto-reply/reply/followup-runner.test.ts Follow-up runner delivery/suppression/fallback rows.
extensions/codex/src/app-server/delivery-no-reply-runtime-contract.test.ts Codex terminal text preservation rows.

Contract Matrix

Path Covered behavior
Follow-up runner Exact/whitespace NO_REPLY payloads do not route to origin or dispatcher and still clean up typing state.
Follow-up runner NO_REPLY payloads with media remain deliverable instead of being suppressed as silent text.
Follow-up runner Successful visible output with incomplete origin routing falls back to dispatcher.
Follow-up runner Existing route-failure and provider-drop rows remain covered by the same focused shard.
Follow-up runner JSON NO_REPLY envelope suppression is explicitly marked todo.
Codex app-server adapter Exact, whitespace, and JSON NO_REPLY terminal text is preserved for shared delivery suppression instead of adapter-specific handling.

Known Red Row

Future row Why not green here
JSON/enveloped NO_REPLY suppression in follow-up delivery Current production delivery suppresses exact text tokens only; behavior change belongs in AgentRuntimePlan delivery policy.

How This Helps The RuntimePlan Work

Delivery is OpenClaw-owned policy. Codex should preserve terminal content and side-channel state; the shared delivery layer should decide whether output is visible, silent, routed to origin, or routed to dispatcher.

Reviewer Notes

  • Test-only; no delivery code changes.
  • The JSON NO_REPLY row is intentionally TODO, not forgotten.
  • Captures the audit’s Bug 4 class without introducing more patch churn in follow-up routing.

Verification

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.auto-reply-reply.config.ts src/auto-reply/reply/followup-runner.test.ts — 28 passed, 1 todo
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.extensions.config.ts extensions/codex/src/app-server/delivery-no-reply-runtime-contract.test.ts
  • ./node_modules/.bin/oxlint --tsconfig tsconfig.oxlint.core.json test/helpers/agents/delivery-no-reply-runtime-contract.ts src/auto-reply/reply/followup-runner.test.ts extensions/codex/src/app-server/delivery-no-reply-runtime-contract.test.ts
  • git diff --check -- test/helpers/agents/delivery-no-reply-runtime-contract.ts src/auto-reply/reply/followup-runner.test.ts extensions/codex/src/app-server/delivery-no-reply-runtime-contract.test.ts

Refs #71004
Follows #71009
Follows #71029
Follows #71038

@100yenadmin 100yenadmin marked this pull request as ready for review April 24, 2026 09:15
Copilot AI review requested due to automatic review settings April 24, 2026 09:15
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 24, 2026

Greptile Summary

This is a test-only PR adding runtime contract tests for the delivery/NO_REPLY policy domain across two test targets: the followup runner and the Codex app-server adapter. No production code is modified; all new assertions are consistent with the existing isSilentReplyPayloadText / isSilentReplyText logic in tokens.ts and the resolveFinalAssistantText trim behavior in CodexAppServerEventProjector.

Confidence Score: 5/5

Safe to merge — test-only change with no production code modified.

All three new test cases correctly reflect the production-code behavior (tokens.ts silent-reply matchers, event-projector text trimming). Assertions are tight and the contract fixture is well-scoped. visibleText is exported but unused in this PR, which is a trivial cosmetic point that does not affect correctness.

No files require special attention.

Reviews (1): Last reviewed commit: "test: add delivery no reply runtime cont..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds test-only runtime contract coverage for Delivery/NO_REPLY behavior across the shared follow-up runner and the Codex app-server adapter, ensuring silent-terminal handling and routing fallback semantics are locked before any production refactors from RFC #71004.

Changes:

  • Introduces a shared delivery NO_REPLY contract fixture used by both core and Codex tests.
  • Adds follow-up runner tests for NO_REPLY suppression (no origin/dispatcher delivery), media deliverability, and dispatcher fallback when origin routing is incomplete.
  • Adds Codex app-server adapter tests ensuring silent terminal text is preserved for shared suppression (exact/whitespace/JSON envelope).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
test/helpers/agents/delivery-no-reply-runtime-contract.ts Adds shared constants for delivery/NO_REPLY contract scenarios.
src/auto-reply/reply/followup-runner.test.ts Adds contract tests covering follow-up NO_REPLY suppression, media deliverability, and dispatcher fallback behavior.
extensions/codex/src/app-server/delivery-no-reply-runtime-contract.test.ts Adds Codex adapter contract test asserting silent terminal text is preserved and recognized as silent by shared token logic.

Comment thread extensions/codex/src/app-server/delivery-no-reply-runtime-contract.test.ts Outdated
Comment thread src/auto-reply/reply/followup-runner.test.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@steipete
Copy link
Copy Markdown
Contributor

Closing as superseded by #71096, which consolidates this contract shard into the single RuntimePlan / Pi-Codex parity review branch.

Codex review note: keeping the individual shard open would split the same contract surface across multiple stale branches now that #71096 carries the combined stack.

@steipete steipete closed this Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants