fix(slack): wrap session key in backticks to prevent emoji shortcode parsing#30266
Conversation
Greptile SummaryWraps the session key in backticks when appending to the usage footer (when
Confidence Score: 5/5
Last reviewed commit: 4cc21dc |
…parsing Session keys like `agent:main:slack:direct:u045c0gtsmb` contain colon-delimited segments that Slack auto-parses as emoji shortcodes. Wrapping the session key in backticks (inline code) prevents Slack from interpreting `:main:`, `:slack:`, `:direct:` as emoji. Fixes openclaw#30258
4cc21dc to
d6aabc4
Compare
|
PR #30266 - fix(slack): wrap session key in backticks to prevent emoji shortcode parsing (#30266) Merged via squash.
Thanks @pushkarsingh32! |
|
Correction on merge summary details:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6aabc4591
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| }); | ||
| if (formatted && responseUsageMode === "full" && sessionKey) { | ||
| formatted = `${formatted} · session ${sessionKey}`; | ||
| formatted = `${formatted} · session \`${sessionKey}\``; |
There was a problem hiding this comment.
Escape backticks before wrapping session key in code span
This interpolation wraps sessionKey in single backticks without escaping the key itself, so any backtick inside the key prematurely closes the code span and produces malformed markdown in the footer. Session keys are built from peer IDs that are lowercased but not punctuation-sanitized (src/routing/session-key.ts:129-142), and some channels can supply IDs/nicks containing ` (for example via extensions/irc/src/inbound.ts:280-288), so with responseUsage=full the Slack formatting fix can regress to broken rendering and re-enable shortcode parsing on the trailing segment.
Useful? React with 👍 / 👎.
…parsing (openclaw#30266) thanks @pushkarsingh32 Cherry-pick of upstream 4ba0a4d.
…parsing (openclaw#30266) thanks @pushkarsingh32 Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: pushkarsingh32 <29558481+pushkarsingh32@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…parsing (openclaw#30266) thanks @pushkarsingh32 Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: pushkarsingh32 <29558481+pushkarsingh32@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…parsing (openclaw#30266) thanks @pushkarsingh32 Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: pushkarsingh32 <29558481+pushkarsingh32@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…parsing (openclaw#30266) thanks @pushkarsingh32 Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: pushkarsingh32 <29558481+pushkarsingh32@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…parsing (openclaw#30266) thanks @pushkarsingh32 Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: pushkarsingh32 <29558481+pushkarsingh32@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…parsing (openclaw#30266) thanks @pushkarsingh32 Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: pushkarsingh32 <29558481+pushkarsingh32@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…parsing (openclaw#30266) thanks @pushkarsingh32 Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: pushkarsingh32 <29558481+pushkarsingh32@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…parsing (openclaw#30266) thanks @pushkarsingh32 Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: pushkarsingh32 <29558481+pushkarsingh32@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…parsing (openclaw#30266) thanks @pushkarsingh32 Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: pushkarsingh32 <29558481+pushkarsingh32@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…parsing (openclaw#30266) thanks @pushkarsingh32 Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: pushkarsingh32 <29558481+pushkarsingh32@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…parsing (openclaw#30266) thanks @pushkarsingh32 Cherry-pick of upstream 4ba0a4d.
…parsing (openclaw#30266) thanks @pushkarsingh32 Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: pushkarsingh32 <29558481+pushkarsingh32@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
Summary
:main:,:slack:,:direct:) as emoji shortcodesBefore:
Usage: 3 in / 1.8k out · session agent:main:slack:direct:u045c0gtsmb(
:main:,:slack:,:direct:rendered as grey emoji placeholder boxes)After:
Usage: 3 in / 1.8k out · session`agent:main:slack:direct:u045c0gtsmb`(session key rendered as inline code — no emoji parsing)
Changes
src/auto-reply/reply/agent-runner.ts: WrapsessionKeyin backticks when appending to usage footersrc/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts: Update test assertion to match new formatTest plan
pnpm test— 23/23 tests pass in the affected file)responseUsage: "full"and confirm the session key renders as inline code without emoji shortcode parsingFixes #30258