Skip to content

fix(adapters/slack): drop mrkdwn from chat.postEphemeral and correct retry docs - #137

Merged
ThomasK33 merged 9 commits into
mainfrom
fix/slack-followups-136
Oct 29, 2026
Merged

ThomasK33 merged 9 commits into
mainfrom
fix/slack-followups-136

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Why

The operator wants every open follow-up issue in coder/chat closed by one small, reviewed PR. This PR closes the five Slack adapter and retry-doc follow-ups from the reviews of #132 and #133, as the triage comment on #136 decided them.

What changed

  • chat.postEphemeral no longer gets a mrkdwn field. Slack lists no such argument for that method, so slackapi.PostEphemeralRequest loses Mrkdwn. The DM fallback keeps "mrkdwn": false on chat.postMessage, and a test now pins it.
  • The withDefaults comment states the real worst-case backoff: 2s (MaxElapsed) with a Slack Retry-After, not about 600ms. ADR 0005 decision 3 now states only the bounds, with a dated amendment note that points to docs: fix stale example, dispatch, and retry text #132. Decision 4 and two Consequences drop the same ack-window claim.
  • A comment at the PostNative payload says why it skips the typed PostMessage: []slackapi.Block models only three block types, and the docs call the payload opaque Block Kit.

Closes #136

Scope

  • No caller or test relied on mrkdwn: false for literal ephemeral text, so the text gets no escape.
  • Plain Text in a native ephemeral message keeps Slack's mrkdwn parsing. Slack has no mrkdwn argument on chat.postEphemeral, so the dropped field likely never turned parsing off. I did not verify this against a live workspace. CONTEXT.md and the interactive-components how-to now record this exception.
  • adapters/linear/retry.go had the same stale 600ms comment, and this PR corrects it too.

Blast Radius

slackapi.PostEphemeralRequest.Mrkdwn is an exported field, so a caller that sets it stops compiling. The field had no documented effect on Slack.

Verification

  • The two new ephemeral tests fail on the test commit and pass on the fix commit. The DM-fallback test fails when the fallback stops sending mrkdwn.
  • A local 429 server that always sends Retry-After: 1 made the default policy return RateLimited after 2.01s and three attempts.
  • go vet, go test for every module, gofmt -l, and go test -race ./adapters/slack/... pass.

Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

With a Slack Retry-After, each sleep reaches MaxDelay (1s), so two
sleeps total MaxElapsed (2s), not about 600ms. A local 429 server that
always sends Retry-After: 1 measured 2.01s over three attempts.
Decision 3 claimed that the deadline check keeps synchronous retry
inside the ack window. It bounds only the backoff sleep. The decision
now says that MaxElapsed bounds the backoff and that the caller's
context and HTTP client bound each HTTP attempt, with a dated note
that points to #132.
A Plain Text ephemeral message that falls back to a DM goes through
chat.postMessage, which documents mrkdwn. The test fails when the
fallback stops sending "mrkdwn": false.
Slack documents mrkdwn for chat.postMessage but not for
chat.postEphemeral. The adapter test posts a Plain Text ephemeral
message and expects no mrkdwn field. The slackapi test sets every
PostEphemeralRequest field and checks that each encoded argument is
one that Slack documents. Both fail until the field goes.
Slack lists no mrkdwn argument for chat.postEphemeral. Remove Mrkdwn
from slackapi.PostEphemeralRequest and stop setting it in
PostEphemeralMessage. The DM fallback still sends "mrkdwn": false
through chat.postMessage. No caller or test relied on the field to send
literal ephemeral text, so the text needs no escape.
A refactor onto the typed PostMessage would decode the native payload
into []slackapi.Block and can drop fields that Block does not model.
docs/reference.md says that PostNative posts opaque Block Kit blocks.
The PostNative comment now names the real limit: []slackapi.Block
models only markdown, actions, and image blocks. The withDefaults
comment drops a sentence that repeated the RetryPolicy doc.
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T22:34:09.376167Z — Manual request
🔒 Security Review ✅ Completed 2026-10-29T22:32:31.037800Z 37b4f91 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 82cff01577

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread adapters/slack/slack.go Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 82cff01577

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 82cff01577

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/adr/0005-rate-limit-handling.md Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 82cff01577

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Decision 4 and two Consequences also said that the default policy
keeps synchronous retry inside the ack deadline. They now say that
the caller's context or HTTP client bounds each HTTP attempt.
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: ded01fbc01

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: ded01fbc01

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

…on, and the Linear bound

PostNative skips the typed PostMessage because Payload is an any that
it must post unchanged, not because Block is closed. CONTEXT.md and
the interactive-components how-to now note that a native ephemeral
Plain Text post keeps Slack formatting. The Linear withDefaults
comment now gives its real worst-case backoff of 2s.
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 37b4f916d8

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ThomasK33
ThomasK33 merged commit 7c6ce4a into main Oct 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adapters/slack: follow-ups from #132 and #133 (retry comment, ADR 0005, mrkdwn tests, PostNative)

1 participant