Skip to content

fix(discord): channel edits persist applied forum tags - #194429

Merged
obviyus merged 7 commits into
openclaw:mainfrom
caseyjkey:fix/discord-channel-edit-applied-tags
Nov 10, 2026
Merged

obviyus merged 7 commits into
openclaw:mainfrom
caseyjkey:fix/discord-channel-edit-applied-tags

Conversation

@caseyjkey

@caseyjkey caseyjkey commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Related: #36736

What Problem This Solves

Fixes: Discord channel-edit reports success without changing forum or media thread tags when appliedTags is provided.

User Impact

User impact: agents can replace or clear a Discord forum thread applied tags through channel-edit, so Kanban status changes persist instead of silently no-oping.

Why This Change Was Made

The action schema already exposes appliedTags, but the Discord channel-edit parser, payload type, and REST adapter did not carry it to Discord applied_tags field. This change wires the value through and deliberately preserves an explicit empty array for both camelCase and snake_case input so callers can clear every tag.

Evidence

  • Focused shared-reader regressions pass: 34/34, including direct-key and snake_case empty arrays.
  • Focused Discord parser regressions pass: 7/7, covering appliedTags, applied_tags, replacement, and clearing.
  • Full Discord extension lane passed 258 test files and 2,682 tests before the final review fix.
  • Updated-head CI is green, including channel tests, type checks, lint, boundaries, CodeQL, and openclaw/ci-gate.
  • git diff --check passes.

Live Discord behavior proof through the shipped action

Run at 2026-11-08T22:31:04Z. The script called the shipped Discord channel-edit action entry point, handleDiscordAction, with the same action payload shape the message tool sends, then independently read the thread from Discord after each PATCH. Tag names are shown; raw tag IDs, channel IDs, user IDs, and credentials are omitted.

entryPoint: handleDiscordAction (shipped Discord channel-edit action)
target: Neon Goals TODOs (forum thread)
before applied_tags: [Done, Automation]

clear:
  toolInput: { action: "channelEdit", appliedTags: [] }
  actionResult.ok: true
  PATCH response applied_tags: []
  independent Discord readback applied_tags: []

restore:
  toolInput: { action: "channelEdit", appliedTags: [Done, Automation] }
  actionResult.ok: true
  PATCH response applied_tags: [Done, Automation]
  independent Discord readback applied_tags: [Done, Automation]
  exactOriginalRestored: true

This proves both explicit clearing and non-empty replacement through the shipped action path against live Discord, and that the original card state is restored exactly afterward.

Base-red / head-green regression evidence

  • Base (pre-fix main): the channel-edit parser drops appliedTags and the REST payload omits applied_tags, so the PATCH reports success while Discord keeps the old tags. Reported upstream in Discord channel-edit does not pass appliedTags to API (forum post tags) #36736.
  • Head: the parser forwards appliedTags (including an explicit empty array for both appliedTags and applied_tags), the REST body carries applied_tags, and the live run above shows the readback changing from [Done, Automation] to [] and back.

@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: XS labels Nov 7, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 7, 2026
@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR carries applied forum thread tags through Discord channel edits and preserves empty arrays so callers can clear tags.

Example: Clear the Done and Automation tags from the Neon Goals TODOs forum thread with appliedTags: [].

  • Before: The action reports success while Discord retains both tags.
  • After: Discord receives applied_tags: [] and an independent readback confirms no tags remain.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused existing-owner repair with shipped-entry-point proof and no actionable findings; required CI has not finished on the reviewed head.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The contributor records live Discord clearing and replacement through handleDiscordAction with independent readback and restoration; obviyus additionally records the exact reviewed head through the Gateway's shipped message tool, showing corrected PATCH bodies and thread state alongside unchanged sibling controls.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Agents report successful Discord forum tag changes while the thread keeps its previous tags.
Reason: This restores an already exposed message-tool parameter with a focused repair and demonstrated user-visible results.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a confirmed Discord tag-editing bug that remains on current main, with no actionable findings; required current-head CI is still pending.

Priority: P2
Reviewed head: aedf433900fa9472a5e96cbead4c1f18e0b694c3

Before merge

None.

Findings

None.

Agent review details

How this fits together

The message tool dispatches channel-edit requests to Discord's shared parameter reader, which prepares the payload that the REST adapter sends to Discord.

flowchart LR
  A[Message tool] --> B[Discord action adapter]
  B --> C[Shared edit parameter reader]
  C --> D[Discord guild action]
  D --> E[Channel REST adapter]
  E --> F[Discord thread tags]
Loading

Technical review

Best possible solution:

Land the existing shared-parser and REST-mapping repair after required current-head CI completes.

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

Current-main source shows both missing forwarding steps, corroborated by the supplied base-versus-candidate Gateway request trace and the original affected-release report; this review ran no target code.

Is this the best way to solve the issue?

The patch repairs the existing owners directly, preserves omission versus explicit clearing, and adds no competing implementation or configuration surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e95289326a79.

Provenance checked

  • Shared string-array normalization keeps the original intent (5bc21ba: Reuse common normalization while preserving trimming, order, duplicates, required errors, alias precedence, and empty optional defaults.)
  • Shared Discord channel-edit parsing keeps the original intent (ec5d403: Unify channel-action parameter parsing across the message adapter and runtime.)
  • Discord forum tag definitions keeps the original intent (feat(discord): support available_tags in channel-edit for forum tag management #12070: Support availableTags for managing forum tag definitions, separately from a thread's applied tags.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit ec5d403 adds extensions/discord/src/actions/runtime.shared.ts:41 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ec5d403f5b2b; files: extensions/discord/src/actions/runtime.shared.ts)
  • Vincent Koc: Raw commit 5bc21ba adds src/agents/tools/common.ts:327 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 5bc21bac091c; files: src/agents/tools/common.ts)

PR surface

Source +11, Tests -1. Total +10 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 12 1 +11
Tests 3 16 17 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 28 18 +10

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Discord forum tag edits silently succeed without updating tags, with a limited channel-management blast radius.
  • merge-risk: 🚨 compatibility: The SDK-exported string-array reader gains opt-in empty-array behavior; existing defaults are preserved and supplied current-head controls cover sibling callers.
  • 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.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (4 earlier review cycles)
  • reviewed 2026-11-07T03:02:25.658Z sha a553842 :: needs real behavior proof before merge. :: [P2] Preserve empty arrays from the snake_case alias
  • reviewed 2026-11-07T22:04:19.482Z sha 106c442 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-08T22:37:48.707Z sha 5616aa3 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-08T23:04:13.489Z sha 5616aa3 :: needs maintainer review before merge. :: none

Reviewed November 10, 2026, 1:48 AM ET / 06:48 UTC (Revision 5).

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S and removed size: XS labels Nov 7, 2026
@caseyjkey

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Fixed the snake_case empty-array finding in 106c442 and added redacted live Discord clear + independent readback + exact restore proof to the PR body.

@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 7, 2026
@caseyjkey

Copy link
Copy Markdown
Contributor Author

Not sure how to get this picked up for human review, but I hope it happens soon. I keep patching my Claw to support Kanban via forum thread tagging and it's wasting bunch of tokens.

@clawsweeper clawsweeper Bot removed the rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. label Nov 8, 2026
@caseyjkey

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added the executed base-red/head-green regression comparison requested in the latest review: #194429 (comment)

@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 8, 2026
@caseyjkey

Copy link
Copy Markdown
Contributor Author

Status: ready for maintainer merge. Automated review now rates this 🦞 diamond lobster (5/6) on readiness, proof, and patch quality, with no remaining findings and "Before merge: None".

  • CI on head 5616aa3 is green (63 checks, 0 failures, openclaw/ci-gate pass).
  • Live proof through the shipped handleDiscordAction entry point: clear → independent Discord readback [] → restore → readback [Done, Automation], exact restoration.
  • Executed base-red/head-green regression comparison posted above.

The contributor account has only READ access to this repository, so it cannot merge or arm auto-merge. A maintainer with write access is needed to land it. Related issue: #36736.

@obviyus

obviyus commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Proof for aedf433: built Gateway on node:24.22.1 in secretless Docker, DISCORD_API_URL pointed at a local Discord REST stand-in that records requests and keeps forum-thread state. Each call went through POST /tools/invoke with the shipped message tool. Main (a65cb61) and candidate were each run twice; the runs match.

Requests the stand-in saw (run 1; run 2 identical), and the thread tags after the call:

# main
1-tags: {"method":"PATCH","path":"/channels/300000000000000001","body":{}} 
2-clear: {"method":"PATCH","path":"/channels/300000000000000001","body":{}} 
3-ctl-name-locked: {"method":"PATCH","path":"/channels/300000000000000001","body":{"name":"renamed","locked":true}} 
4-ctl-available-tags: {"method":"PATCH","path":"/channels/200000000000000001","body":{"available_tags":[{"name":"t3"}]}} 
5-ctl-thread-create-empty: {"method":"POST","path":"/channels/200000000000000001/threads","body":{"name":"ctl","message":{"content":"hi"}}} 
6-ctl-sticker-empty: 
thread applied_tags after 1-tags: []
thread applied_tags after 2-clear: []
tool results: true true true true true false 

# candidate
1-tags: {"method":"PATCH","path":"/channels/300000000000000001","body":{"applied_tags":["400000000000000001","400000000000000002"]}} 
2-clear: {"method":"PATCH","path":"/channels/300000000000000001","body":{"applied_tags":[]}} 
3-ctl-name-locked: {"method":"PATCH","path":"/channels/300000000000000001","body":{"name":"renamed","locked":true}} 
4-ctl-available-tags: {"method":"PATCH","path":"/channels/200000000000000001","body":{"available_tags":[{"name":"t3"}]}} 
5-ctl-thread-create-empty: {"method":"POST","path":"/channels/200000000000000001/threads","body":{"name":"ctl","message":{"content":"hi"}}} 
6-ctl-sticker-empty: 
thread applied_tags after 1-tags: ["400000000000000001","400000000000000002"]
thread applied_tags after 2-clear: []
tool results: true true true true true false 

Main reports success for both tag edits but sends an empty PATCH, so the tags never change. The candidate sends applied_tags and the thread state follows, including clearing with []. Controls match on both: an edit without appliedTags (name/locked) sends no applied_tags, availableTags edits are unchanged, thread-create with appliedTags: [] (another readStringArrayParam caller) still drops the field, and sticker with stickerId: [] still fails with sticker-id required.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 10, 2026
@obviyus
obviyus merged commit baccc7e into openclaw:main Nov 10, 2026
129 of 131 checks passed
@obviyus

obviyus commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Landed in baccc7e. Thanks @caseyjkey. Discord channel-edit now saves forum thread tags.

@caseyjkey

Copy link
Copy Markdown
Contributor Author

Thank you!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 11, 2026
fix(discord): channel edits persist applied forum tags

Discord channel-edit exposed appliedTags in its schema, but the parser, payload and REST adapter never carried it. The tool reported success while the forum thread's tags stayed unchanged. appliedTags is now forwarded as applied_tags. The shared readStringArrayParam gains an optional allowEmpty setting, off by default, so an explicit [] can clear tags; every existing caller keeps its current behavior.

Evidence: a built Gateway on node:24.22.1 in secretless Docker, Discord pointed at a local stand-in that records requests and keeps forum-thread state, calls made through POST /tools/invoke with the message tool, two runs each. On main, channel-edit with appliedTags [t1, t2] and then [] reported success with an empty PATCH body and the tags never changed. With this change the PATCH carries applied_tags, the thread takes both tags, and [] clears them. An edit with only name and locked, an availableTags edit, thread-create with appliedTags [] and sticker with an empty stickerId behave the same on both. Details: openclaw#194429 (comment).

Thanks @caseyjkey.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Nov 23, 2026
…94429)

Backport of baccc7e.

Release adaptation: omit unrelated numeric test cleanup; carry explicit-empty parser and complete channel serialization plus focused regression.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit f1589c4f1784cf1aeef4c794a4bbe784f0b9aaac)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling 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: 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.

2 participants