Skip to content

Expose paged channel action results#88993

Merged
steipete merged 10 commits into
openclaw:mainfrom
fuller-stack-dev:codex/channel-paged-action-results
Jun 13, 2026
Merged

Expose paged channel action results#88993
steipete merged 10 commits into
openclaw:mainfrom
fuller-stack-dev:codex/channel-paged-action-results

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Preserve the existing Discord thread-list raw threads result while adding normalized pagination metadata at the action boundary.
  • Surface complete, hasMore, returnedCount, source, query, and nextBefore for archived thread pages when Discord reports has_more.
  • Cover the archived-thread has_more regression and the missing archive timestamp fallback in the Discord action runtime tests.

Verification

  • PATH=/Users/jason/.nvm/versions/node/v24.14.0/bin:$PATH node scripts/run-vitest.mjs extensions/discord/src/actions/runtime.test.ts extensions/discord/src/send.messages.test.ts (97 passed)
  • PATH=/Users/jason/.nvm/versions/node/v24.14.0/bin:$PATH node scripts/run-vitest.mjs src/agents/anthropic-transport-stream.test.ts src/agents/simple-completion-runtime.test.ts
  • git diff --check
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/main --codex-bin /Users/jason/.codex/openclaw-pr-autopilot/bin/codex-persist-sessions --model codex=kepler-alpha --thinking codex=high (clean; no accepted/actionable findings)
  • Crabbox/Testbox E2E on the earlier PR head: provider <test-provider>, lease <test-lease>, Actions run <actions-run-url>; checked out <pr-ref> and ran corepack pnpm test:docker:npm-onboard-discord-channel-agent, result npm tarball onboard/channel/agent Docker E2E passed (discord).

Real behavior proof

Behavior addressed: Discord archived thread-list actions expose truthful page completion plus a reusable nextBefore cursor while preserving the prior raw threads provider payload.

Real environment tested: Exact PR head 1a2d7b4fec5f089d730acfd257602f82d4fc0648, with the local PR branch Discord action runtime calling the live Discord API for the configured <account-id> bot account in a test guild. Three disposable public threads were created in <channel-name>, archived, paged, and deleted.

Exact steps or command run after this patch: Ran a redacted node --import tsx --input-type=module proof script from the PR worktree. The script resolved only the configured Discord account token from the active runtime snapshot, installed that resolved snapshot in the proof process, called branch handleDiscordAction to create and archive three disposable threads, requested archived threads with limit: 2, requested the next page with before: firstPage.nextBefore, asserted thread identities and cursor equality, then deleted every proof thread in finally.

Evidence after fix:

{
  "headSha": "1a2d7b4fec5f089d730acfd257602f82d4fc0648",
  "environment": "local PR branch action runtime against live Discord API",
  "setup": {
    "created": 3,
    "archived": 3,
    "channel": "<channel-name>",
    "pageLimit": 2
  },
  "firstPage": {
    "complete": false,
    "hasMore": true,
    "returnedCount": 2,
    "source": "discord.threadList.archived",
    "query": {
      "guildId": "<guild-id>",
      "channelId": "<channel-id>",
      "includeArchived": true,
      "limit": 2
    },
    "nextBefore": "2026-06-12T20:45:07.612000+00:00",
    "lastArchiveTimestamp": "2026-06-12T20:45:07.612000+00:00",
    "rawHasMore": true,
    "items": ["<proof-thread-newest>", "<proof-thread-middle>"]
  },
  "continuationPage": {
    "complete": true,
    "hasMore": false,
    "returnedCount": 1,
    "source": "discord.threadList.archived",
    "query": {
      "guildId": "<guild-id>",
      "channelId": "<channel-id>",
      "includeArchived": true,
      "before": "2026-06-12T20:45:07.612000+00:00",
      "limit": 2
    },
    "rawHasMore": false,
    "contains": "<proof-thread-oldest>"
  },
  "assertions": {
    "cursorMatchesLastArchiveTimestamp": true,
    "continuationUsedNextBefore": true,
    "firstPageContainsNewestAndMiddleProofThreads": true,
    "continuationContainsOldestProofThread": true
  },
  "cleanup": {
    "deleted": 3,
    "cleanupFailures": 0
  }
}

Observed result after fix: The first live archived page returned two non-empty rows with Discord has_more: true; the normalized result exposed complete: false, hasMore: true, and a nextBefore exactly equal to the last returned thread's archive timestamp. Passing that value back as before returned the older proof thread and a complete final page. All three disposable threads were deleted successfully.

What was not tested: A full PR-branch gateway/CLI end-to-end run. Discord thread-list is gateway-owned, so a source-plugin override with the currently installed gateway still exercises the installed gateway action runtime. The live proof instead targets the exact changed plugin action boundary against Discord. No supported Mantis scenario covers Discord archived-thread pagination.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord gateway Gateway runtime size: XL triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 1, 2026
@clawsweeper

clawsweeper Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 13, 2026, 12:20 AM ET / 04:20 UTC.

Summary
Review failed before ClawSweeper could summarize the requested change.

PR surface: Source +78, Tests +133. Total +211 across 2 files.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: vector/embedding metadata: extensions/discord/src/actions/runtime.messaging.send.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🌊 off-meta tidepool
Proof: 🌊 off-meta tidepool
Patch quality: 🌊 off-meta tidepool
Result: rating does not apply to this item.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] No close action taken because the review did not complete.

Maintainer options:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Review did not complete, so no work-lane recommendation was made.
Review details

Best possible solution:

Retry the Codex review after fixing the execution failure.

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

Unclear. The review failed before ClawSweeper could establish a reproduction path.

Is this the best way to solve the issue?

Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 4a6666796f46.

Label changes

Label changes:

  • add rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.
  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.
  • remove P2: Current review triage priority is none.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🌊 off-meta tidepool, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove status: 👀 ready for maintainer look: Current PR status no longer selects a status label.

Label justifications:

  • rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.
Evidence reviewed

PR surface:

Source +78, Tests +133. Total +211 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 79 1 +78
Tests 1 133 0 +133
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 212 1 +211

What I checked:

  • failure reason: model unavailable or access denied.
  • codex failure detail: Codex review failed for this PR with exit 1.
  • codex stderr: No stderr captured.
  • codex stdout: {"type":"thread.started","thread_id":"019ebf35-47f3-7803-a5a6-d9908aa7a8f3"}.
  • codex terminal error: stream disconnected before completion: The model [REDACTED_INTERNAL_MODEL] does not exist or you do not have access to it.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jun 1, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. label Jun 1, 2026
@fuller-stack-dev
fuller-stack-dev force-pushed the codex/channel-paged-action-results branch from 4a479de to 1533e0f Compare June 1, 2026 08:04
@openclaw-barnacle openclaw-barnacle Bot added size: M and removed gateway Gateway runtime size: XL labels Jun 1, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jun 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Jun 1, 2026
@fuller-stack-dev
fuller-stack-dev force-pushed the codex/channel-paged-action-results branch from 1533e0f to 4acda7c Compare June 1, 2026 08:27
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 1, 2026
@fuller-stack-dev
fuller-stack-dev force-pushed the codex/channel-paged-action-results branch from 4acda7c to ffb330a Compare June 1, 2026 15:02
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 1, 2026
@thewilloftheshadow thewilloftheshadow self-assigned this Jun 5, 2026
…ction-results

# Conflicts:
#	docs/.generated/plugin-sdk-api-baseline.sha256
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 10, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 10, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed docs Improvements or additions to documentation size: M labels Jun 11, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 11, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Fresh local maintainer proof before this request:

  • node scripts/run-vitest.mjs extensions/discord/src/actions/runtime.test.ts
  • node scripts/run-vitest.mjs src/agents/anthropic-transport-stream.test.ts src/agents/simple-completion-runtime.test.ts
  • git diff --check upstream/main...HEAD
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/main --codex-bin /Users/jason/.codex/openclaw-pr-autopilot/bin/codex-persist-sessions --model codex=gpt-5.5 --thinking codex=high

Autoreview result: clean, no accepted/actionable findings.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 12, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 12, 2026
@steipete

Copy link
Copy Markdown
Contributor

Land-ready verification completed on head 880a6832509bd5b065ac5cdcef79dace0b3495a6.

Review:

  • Deep review covered the Discord action entry point, messaging runtime, REST wrapper, action schema, callers, sibling active/archive behavior, adjacent tests, and the installed discord-api-types pagination contract.
  • Best-fix judgment: yes. Pagination metadata stays Discord-plugin-local, preserves the raw provider payload, and derives the continuation cursor from Discord's archived-thread timestamp contract.
  • Added focused coverage for exact before forwarding and active-thread completeness.
  • Autoreview: branch review clean (0.96 confidence); added-test review clean (0.98 confidence).

Verification:

Live behavior:

  • Exact changed runtime at 1a2d7b4fec5f089d730acfd257602f82d4fc0648 was exercised against live Discord: three disposable archived threads, page size 2, has_more: true, nextBefore equal to the final archive timestamp, successful continuation, then cleanup of all three threads.
  • Final-head delta after that proof is test-only (880a683250); production bytes are unchanged.

Known gap: no full gateway/CLI end-to-end run on final head. The exact changed plugin action boundary has live Discord proof, and the final test-only delta has focused and remote-gate coverage.

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

Labels

channel: discord Channel integration: discord merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants