fix(discord): inherit default_auto_archive_duration in createThreadDiscord#103413
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 10, 2026, 6:44 AM ET / 10:44 UTC. Summary 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 follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest 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 changesLabel justifications:
Evidence reviewedPR surface: Source +10, Tests +37. Total +47 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
…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]>
Co-authored-by: 陈志强0668000989 <[email protected]>
32e1dd3 to
2f66935
Compare
Co-authored-by: 陈志强0668000989 <[email protected]>
|
Land-ready maintainer proof for exact head
Official Discord contract checked: channel defaults and thread auto-archive behavior. |
|
Merged via squash.
|
…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]>
…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]>
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
createThreadDiscordalready 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:createThreadForBindingno longer injects a binding-specific 60-minute policy.default_auto_archive_durationwhen Discord returns it.autoArchiveMinutesremains authoritative.This matches Discord's documented model: channel defaults are copied into newly created threads by clients, while REST thread creation accepts
auto_archive_durationexplicitly. 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
2f66935d12f: parent default10080; created thread read back10080; test thread deleted.Co-authored-by: 陈志强0668000989 [email protected]