Skip to content

fix(discord): report pending message search indexes - #118573

Merged
steipete merged 1 commit into
mainfrom
codex/auto-qa-discord-search-index-warming-2e
Aug 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/auto-qa-discord-search-index-warming-2e

Conversation

@steipete

@steipete steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Discord message search reported success with an empty result when Discord actually returned HTTP 202 because the guild's message index was not ready. The public message-search tool and CLI both falsely presented the unfinished search as complete.

Why This Change Was Made

Discord's actual installed API contract represents index warming as { "code": 110000, "retry_after": ... }, while Undici correctly treats HTTP 202 as a successful HTTP status. The existing Discord search response owner now recognizes that official response shape, reuses the existing retry-after parser, and reports an actionable retry delay. Genuine empty/successful results, rate limits, ordinary HTTP failures, and malformed-response handling retain their existing ownership.

The change touches two existing Discord plugin files and adds 15 production lines. It adds no configuration, dependencies, persisted state, public API, packaging surface, or alternative transport.

User Impact

An operator or agent receives a clear retryable search-index-warming error instead of a misleading success or empty result. Successful searches and the existing Discord rate-limit behavior remain unchanged.

Evidence

  • Four independent nonauthor hostile whole-owner reviews and a genuine official gpt-5.6-sol high-reasoning P0–P3 autoreview found no actionable issues; the official review reported 0.93 confidence and the real authenticated TruffleHog scan was clean.
  • An owned Blacksmith Testbox proved the unchanged-parent failure through the real installed [email protected] contract, [email protected], credential-free localhost HTTP 202 responses, actual Discord REST request handling, the public message action, and the real CLI formatter.
  • The unchanged parent made exactly 11 authenticated Discord search requests and incorrectly reported both action and CLI success. The fixed head made exactly 16 authenticated search requests across independently checked warming, fractional/zero/invalid retry delay, fallback-message, empty, real-result, malformed-result, 429 rate-limit, and HTTP-error scenarios.
  • 327 tests passed: nine complete Discord search-owner tests, 17 real CLI formatter tests, and 301 Discord action/REST/channel sibling tests.
  • The complete exact-two-file changed gate passed, including repository guards, formatting, plugin boundaries, production and test typechecks, changed-file lint, dead exports, and runtime import cycles.
  • Authenticated exact-head proof workflow: https://github.com/openclaw/openclaw/actions/runs/30794841737. Lease tbx_01kz39c4fgnjm7ktx0qxwpeay6 completed with authoritative exitCode: 0 and was stopped; the hosting Actions workflow can appear cancelled after successful delegated lease cleanup.

Maintainer review resolution

  • Resolve merge risk: Exact reviewed head 4affa32abd797377d13ffc9755fe318a8aa4b1d5 passed actual HTTP-202 Discord action and CLI scenarios, preserved empty searches, 429s, HTTP failures, and retry timing, and completed 327 owner/sibling tests plus the full changed-file gate.
  • Complete next step: The repository maintainer explicitly delegated autonomous maintainer review and landing for this campaign; four independent nonauthor hostile reviews and a genuine official Sol P0–P3 review found no actionable findings.

Real behavior proof

{
  "status": "PASS",
  "head": "4affa32abd797377d13ffc9755fe318a8aa4b1d5",
  "parent": "2e46ab1f231a65f26ce25cae5e317f6df2308fde",
  "channel": "discord",
  "officialDiscordIndexWarmingCode": 110000,
  "unchangedParentFalseToolSuccess": true,
  "unchangedParentFalseCliSuccess": true,
  "unchangedParentSearchRequests": 11,
  "candidateSearchRequests": 16,
  "candidateLoopbackHttpRequests": 17,
  "candidateActionableWarmingFailure": true,
  "retryAfterPreserved": true,
  "emptyAndRealResultsRemainSuccessful": true,
  "rateLimitAndHttpErrorsUnchanged": true,
  "malformedSuccessRejected": true,
  "ownerTestsPassed": 9,
  "cliTestsPassed": 17,
  "discordSiblingTestsPassed": 301,
  "testsPassed": 327,
  "externalNetworkRequests": 0,
  "credentialsUsed": false,
  "productionLinesAddedNet": 15,
  "changedGate": "PASS: complete exact-two-file changed gate",
  "runner": "blacksmith-testbox",
  "run": "https://github.com/openclaw/openclaw/actions/runs/30794841737"
}

@steipete
steipete marked this pull request as ready for review August 3, 2026 07:57
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 4:23 AM ET / 08:23 UTC.

ClawSweeper review

What this changes

This PR makes Discord message search report a guild’s warming search index and retry delay as an error instead of returning it as a successful empty or malformed search result.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for landing: current main can turn Discord’s successful HTTP 202 index-warming payload into an ok: true action result, while the proposed response-owner guard converts only the documented warming shape into an actionable retryable error. No discrete correctness or security defect was found in the two-file patch; refresh it against current main and require green exact-head merge checks before landing.

Priority: P1
Reviewed head: 4affa32abd797377d13ffc9755fe318a8aa4b1d5

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A narrow owner-boundary repair with strong supplied real-behavior proof and focused regression coverage; only the normal refreshed-head merge gates remain.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body contains exact-head after-fix live-output evidence for credential-free HTTP-202 behavior through the Discord REST client, public action, and CLI formatter, including the observed improvement over the parent.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body contains exact-head after-fix live-output evidence for credential-free HTTP-202 behavior through the Discord REST client, public action, and CLI formatter, including the observed improvement over the parent.
Evidence reviewed 7 items Current main permits the false-success shape: The current search owner only verifies that Discord returned an object; it does not require a messages array or recognize the index-warming code, so the payload continues to the action layer.
HTTP 202 reaches the response owner as parsed data: The Discord REST client throws only for 429 or non-OK responses and otherwise returns the parsed body; an HTTP 202 is therefore not rejected before message-search validation.
Downstream action currently presents the object as success: After search returns, the Discord action wraps the response in an ok: true result and only conditionally normalizes messages, which explains how an index-warming object can be presented as completed.
Findings None None.
Security None None.

How this fits together

Discord message search passes a REST response through the Discord plugin’s search owner before the channel action and CLI present it to an operator or agent. The change distinguishes the temporary index-warming payload from valid search-result objects so downstream paths do not emit false success.

flowchart LR
  A[Discord message search request] --> B[Discord REST client]
  B --> C[Search response payload]
  C --> D[Discord search response owner]
  D -->|Index warming| E[Retryable error with delay]
  D -->|Messages array| F[Action and CLI success result]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind current main, and the supplied check snapshot still includes failed and in-progress merge checks; refresh/rebase and rerun the required exact-head checks before landing, even though the supplied delegated proof reports a passing behavior run.
  • Complete next step (P2) - No mechanical repair is indicated; the maintainer-facing next action is to refresh the branch and exact-head checks before merge.
Agent review details

Security

None.

PR surface

Source +15, Tests +32. Total +47 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 16 1 +15
Tests 1 32 0 +32
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 48 1 +47

Review metrics

Metric Value Why it matters
Production versus test LOC production +15 net, tests +32 The production growth is a focused response-ownership invariant with direct regression coverage for valid empty searches, warming responses, and malformed objects.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase the narrow response-owner repair onto current main, retain the focused empty/warming/malformed-result coverage, and merge once the refreshed exact head has green required checks and the HTTP-202 action/CLI proof still passes.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase the narrow response-owner repair onto current main, retain the focused empty/warming/malformed-result coverage, and merge once the refreshed exact head has green required checks and the HTTP-202 action/CLI proof still passes.

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

Yes—source-reproducible with high confidence: current main returns every successful HTTP response body to the search owner, which accepts the warming object, and the action then emits ok: true. The PR body also provides an exact-head HTTP-202 action and CLI proof against the parent and candidate.

Is this the best way to solve the issue?

Yes. The response owner is the canonical boundary because it is where the successful-but-not-search-result payload first becomes an application value; fixing the CLI or action consumer would leave sibling callers exposed.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0cad02313a9c.

Labels

Label changes:

  • add P1: A Discord search can currently report a temporary index-warming response as success, misleading operators and agents on a supported channel workflow.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains exact-head after-fix live-output evidence for credential-free HTTP-202 behavior through the Discord REST client, public action, and CLI formatter, including the observed improvement over the parent.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body contains exact-head after-fix live-output evidence for credential-free HTTP-202 behavior through the Discord REST client, public action, and CLI formatter, including the observed improvement over the parent.

Label justifications:

  • P1: A Discord search can currently report a temporary index-warming response as success, misleading operators and agents on a supported channel workflow.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body contains exact-head after-fix live-output evidence for credential-free HTTP-202 behavior through the Discord REST client, public action, and CLI formatter, including the observed improvement over the parent.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains exact-head after-fix live-output evidence for credential-free HTTP-202 behavior through the Discord REST client, public action, and CLI formatter, including the observed improvement over the parent.

Evidence

What I checked:

  • Current main permits the false-success shape: The current search owner only verifies that Discord returned an object; it does not require a messages array or recognize the index-warming code, so the payload continues to the action layer. (extensions/discord/src/send.messages.ts:251, 0cad02313a9c)
  • HTTP 202 reaches the response owner as parsed data: The Discord REST client throws only for 429 or non-OK responses and otherwise returns the parsed body; an HTTP 202 is therefore not rejected before message-search validation. (extensions/discord/src/internal/rest.ts:262, 0cad02313a9c)
  • Downstream action currently presents the object as success: After search returns, the Discord action wraps the response in an ok: true result and only conditionally normalizes messages, which explains how an index-warming object can be presented as completed. (extensions/discord/src/actions/runtime.messaging.messages.ts:245, 0cad02313a9c)
  • Patch repairs the owning boundary and preserves valid empties: The PR head recognizes code 110000, reuses the plugin retry-after parser, then requires a messages array; its focused tests cover a valid empty result, index warming with delay, and malformed object responses. (extensions/discord/src/send.messages.ts:256, 4affa32abd79)
  • Focused regression coverage: The PR-head tests assert the retryable warming error and confirm that a normal empty messages array remains successful. (extensions/discord/src/send.messages.test.ts:69, 4affa32abd79)
  • Feature provenance and current-main status: Blame attributes the original search owner and action path to the same feature-introduction commit; the PR head is not an ancestor of current main, so the repair is still necessary rather than already implemented. (extensions/discord/src/send.messages.ts:233, d6f964513f14)

Likely related people:

  • joshavant: Current-main blame ties the central search owner and downstream Discord search action to the feature-introduction commit. (role: feature introducer; confidence: high; commits: d6f964513f14; files: extensions/discord/src/send.messages.ts, extensions/discord/src/actions/runtime.messaging.messages.ts, extensions/discord/src/retry-after.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: XS maintainer Maintainer-authored PR labels Aug 3, 2026
@steipete
steipete merged commit e97f484 into main Aug 3, 2026
185 of 208 checks passed
@steipete
steipete deleted the codex/auto-qa-discord-search-index-warming-2e branch August 3, 2026 09:13
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 3, 2026
* origin/main:
  refactor(tts): absorb speech core package (#118513)
  fix(qa): restore Telegram release validation (#118542)
  fix(discord): report pending message search indexes (#118573)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
* origin/main:
  refactor(tts): absorb speech core package (openclaw#118513)
  fix(qa): restore Telegram release validation (openclaw#118542)
  fix(discord): report pending message search indexes (openclaw#118573)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant