Skip to content

fix(discord): inherit default_auto_archive_duration in createThreadDiscord#103413

Merged
steipete merged 3 commits into
openclaw:mainfrom
wings1029:fix/discord-thread-binding-archive-duration
Jul 13, 2026
Merged

fix(discord): inherit default_auto_archive_duration in createThreadDiscord#103413
steipete merged 3 commits into
openclaw:mainfrom
wings1029:fix/discord-thread-binding-archive-duration

Conversation

@wings1029

@wings1029 wings1029 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Discord session bindings forced every newly created child thread to auto-archive after 60 minutes. That override ignored the parent channel's default_auto_archive_duration, so operators who configured a longer lifetime saw binding-created threads disappear from the active channel list much sooner than expected.

Why This Change Was Made

createThreadDiscord already fetches parent metadata for standalone thread creation. The shared helper is therefore the right owner for carrying Discord's parent default into the create request:

  • createThreadForBinding no longer injects a binding-specific 60-minute policy.
  • Standalone text, announcement, forum, and media thread creation inherits default_auto_archive_duration when Discord returns it.
  • An explicit autoArchiveMinutes remains authoritative.
  • Message-attached thread creation still skips the parent lookup and preserves explicit values.
  • Parent lookup remains best-effort; a metadata failure still lets Discord validate the create request.

This matches Discord's documented model: channel defaults are copied into newly created threads by clients, while REST thread creation accepts auto_archive_duration explicitly. See Discord Channels and Discord Threads.

User Impact

Binding-created Discord threads now honor the parent channel's configured archive lifetime instead of silently forcing 60 minutes. Existing explicit thread-create overrides are unchanged.

Evidence

  • Focused Blacksmith Testbox: 70 Discord tests passed across shared thread creation and binding lifecycle coverage.
  • Changed-surface gate passed: extension production/test tsgo, lint, format, dependency, SDK, database-first, and import-cycle checks.
  • Live Discord exact-source proof on head 2f66935d12f: parent default 10080; created thread read back 10080; test thread deleted.
  • Fresh autoreview: no accepted or actionable findings.

Co-authored-by: 陈志强0668000989 [email protected]

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: S labels Jul 10, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 10, 2026
@clawsweeper

clawsweeper Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 10, 2026, 6:44 AM ET / 10:44 UTC.

Summary
The PR removes the session-binding path’s hardcoded 60-minute archive duration and makes route-less Discord thread creation inherit the parent channel’s default unless the caller explicitly overrides it.

PR surface: Source +10, Tests +37. Total +47 across 4 files.

Reproducibility: yes. Current main clearly reproduces the faulty request construction at source level because the binding caller always supplies 60 minutes, although no live Discord token reproduction was performed in this read-only review.

Review metrics: none identified.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

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

Rank-up moves:

  • Provide redacted live Discord proof showing inherited and explicitly overridden archive durations.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR contains tests and typecheck evidence only; add redacted live Discord create/read-back output, logs, or a recording showing the resulting archive duration, then update the PR body to trigger a fresh review or ask a maintainer to comment @clawsweeper re-review if it does not restart automatically.

Risk before merge

  • [P1] The PR body provides test and typecheck results but no after-fix live Discord create/read-back evidence, so the external-contributor proof gate remains unmet.

Maintainer options:

  1. Decide the mitigation before merge
    Land the shared-helper fix after redacted live Discord proof confirms that a binding-created thread inherits the parent duration and that an explicit caller value still wins.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] The code does not need a repair lane; the remaining blocker is contributor-supplied real behavior proof that automation cannot manufacture for the contributor’s setup.

Security
Cleared: The diff only changes Discord request construction and focused tests, with no dependency, workflow, permission, secret, download, or package-resolution changes.

Review details

Best possible solution:

Land the shared-helper fix after redacted live Discord proof confirms that a binding-created thread inherits the parent duration and that an explicit caller value still wins.

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

Yes. Current main clearly reproduces the faulty request construction at source level because the binding caller always supplies 60 minutes, although no live Discord token reproduction was performed in this read-only review.

Is this the best way to solve the issue?

Yes. Moving fallback behavior into the existing shared route-less thread helper is the narrowest maintainable solution, preserves explicit precedence, and avoids duplicating channel lookup logic in each caller.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 29d018f0af5e.

Label changes

Label justifications:

  • P2: This is a bounded Discord thread-lifetime bug with a focused fix and limited blast radius.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR contains tests and typecheck evidence only; add redacted live Discord create/read-back output, logs, or a recording showing the resulting archive duration, then update the PR body to trigger a fresh review or ask a maintainer to comment @clawsweeper re-review if it does not restart automatically.
Evidence reviewed

PR surface:

Source +10, Tests +37. Total +47 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 15 5 +10
Tests 2 66 29 +37
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 81 34 +47

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored the commit that introduced the current thread helper and binding path, and merged the adjacent archive-default fix. (role: introduced behavior and recent merger; confidence: high; commits: 4a4a32a5de15, 3dd5c1880f46; files: extensions/discord/src/send.messages.ts, extensions/discord/src/monitor/thread-bindings.discord-api.ts, extensions/discord/src/send.outbound.ts)
  • tzy-17: The merged sibling work originated from tzy-17 and established the same configured archive-duration invariant in the Discord outbound send path. (role: recent adjacent contributor; confidence: medium; commits: 3dd5c1880f46; files: extensions/discord/src/send.outbound.ts, extensions/discord/src/send.sends-basic-channel-messages.test.ts)
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.

@steipete steipete self-assigned this Jul 13, 2026
wings1029 and others added 2 commits July 13, 2026 18:20
…scord

When createThreadForBinding hardcoded autoArchiveMinutes: 60, the
parent channel's default_auto_archive_duration (configured by
operators at 1440, 4320, or 10080) was silently overridden. This is
the same pattern fixed in openclaw#103033 for sendMessageDiscord's implicit
forum thread creation.

- Move the auto_archive_duration set after the channel fetch in
  createThreadDiscord so channel.default_auto_archive_duration can
  serve as a fallback when autoArchiveMinutes is not provided.
- Remove the hardcoded autoArchiveMinutes: 60 from
  createThreadForBinding so it inherits the channel default for
  forum/media channels and omits the field for text channels
  (preserving Discord's server-side default).
- Explicit autoArchiveMinutes from callers (thread-create action,
  auto-thread config) still take priority via the ?? operator.

Co-Authored-By: Claude <[email protected]>
@steipete
steipete force-pushed the fix/discord-thread-binding-archive-duration branch from 32e1dd3 to 2f66935 Compare July 13, 2026 17:20
@steipete

Copy link
Copy Markdown
Contributor

Land-ready maintainer proof for exact head dc37604e273ef1a68865c2a01a5cde7f76be1663:

  • Owner boundary: extensions/discord/src/monitor/thread-bindings.discord-api.ts:286 no longer forces a binding-only 60-minute policy. extensions/discord/src/send.messages.ts:47 and extensions/discord/src/send.messages.ts:161 now own parent metadata lookup and request construction for standalone threads.
  • Behavior: parent default_auto_archive_duration is inherited when no explicit override is supplied; explicit autoArchiveMinutes still wins; message-attached threads avoid the extra parent lookup.
  • Regression proof: Testbox tbx_01kxe6g7dj7xwk1csfn75y622m ran the focused Discord thread suites: 70/70 passed. The same lease passed the changed gate, including extension production/test tsgo, lint, format, import-cycle, dependency, SDK, and database-first guards.
  • Live Discord proof from this exact source: approved sandbox parent reported default_auto_archive_duration=10080; the created thread read back thread_metadata.auto_archive_duration=10080; cleanup deleted the thread. Result: passed=true.
  • Exact-head CI: run 29270130597, 46 successful jobs, 11 expected skips, zero failures.
  • Fresh autoreview: clean; no accepted or actionable findings.
  • Duplicate sweep: no open Discord auto-archive PRs or issues found.

Official Discord contract checked: channel defaults and thread auto-archive behavior.

@steipete
steipete merged commit fd49e97 into openclaw:main Jul 13, 2026
98 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

wm0018 pushed a commit to wm0018/openclaw that referenced this pull request Jul 14, 2026
…scord (openclaw#103413)

* fix(discord): inherit default_auto_archive_duration in createThreadDiscord

When createThreadForBinding hardcoded autoArchiveMinutes: 60, the
parent channel's default_auto_archive_duration (configured by
operators at 1440, 4320, or 10080) was silently overridden. This is
the same pattern fixed in openclaw#103033 for sendMessageDiscord's implicit
forum thread creation.

- Move the auto_archive_duration set after the channel fetch in
  createThreadDiscord so channel.default_auto_archive_duration can
  serve as a fallback when autoArchiveMinutes is not provided.
- Remove the hardcoded autoArchiveMinutes: 60 from
  createThreadForBinding so it inherits the channel default for
  forum/media channels and omits the field for text channels
  (preserving Discord's server-side default).
- Explicit autoArchiveMinutes from callers (thread-create action,
  auto-thread config) still take priority via the ?? operator.

Co-Authored-By: Claude <[email protected]>

* refactor(discord): preserve parent thread archive defaults

Co-authored-by: 陈志强0668000989 <[email protected]>

* docs(changelog): credit Discord archive default fix

Co-authored-by: 陈志强0668000989 <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 14, 2026
…scord (openclaw#103413)

* fix(discord): inherit default_auto_archive_duration in createThreadDiscord

When createThreadForBinding hardcoded autoArchiveMinutes: 60, the
parent channel's default_auto_archive_duration (configured by
operators at 1440, 4320, or 10080) was silently overridden. This is
the same pattern fixed in openclaw#103033 for sendMessageDiscord's implicit
forum thread creation.

- Move the auto_archive_duration set after the channel fetch in
  createThreadDiscord so channel.default_auto_archive_duration can
  serve as a fallback when autoArchiveMinutes is not provided.
- Remove the hardcoded autoArchiveMinutes: 60 from
  createThreadForBinding so it inherits the channel default for
  forum/media channels and omits the field for text channels
  (preserving Discord's server-side default).
- Explicit autoArchiveMinutes from callers (thread-create action,
  auto-thread config) still take priority via the ?? operator.

Co-Authored-By: Claude <[email protected]>

* refactor(discord): preserve parent thread archive defaults

Co-authored-by: 陈志强0668000989 <[email protected]>

* docs(changelog): credit Discord archive default fix

Co-authored-by: 陈志强0668000989 <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants