Skip to content

fix: Telegram plugin binding, push dedupe, model list, /current - #1

Merged
cursor[bot] merged 3 commits into
mainfrom
cursor/fix-telegram-plugin-bugs-ff64
Oct 30, 2026
Merged

cursor[bot] merged 3 commits into
mainfrom
cursor/fix-telegram-plugin-bugs-ff64

Conversation

@HenryYannis

@HenryYannis HenryYannis commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes the high-priority bugs found in the OpenCode V2 plugin review, and adds a conventional CI pipeline.

Bug fixes

  • Session rebind: bindChat now removes the chat from the previous session’s sessionToChats set.
  • Push path: uses session.text.ended’s data.text with msgID:ordinal dedupe so multi-segment assistant replies are not dropped; event + wait() fallback share delivery locks to avoid duplicates.
  • Models: prefers ctx.model.list() and correctly reads { data: ModelInfo[] }; config parse is fallback only. Pins @opencode/plugin to ^2.2.0.
  • /current: tracks session.viewed, lists with order: "desc" (not limited to home), and no longer requires the home location to start the bot (file lock singleton).
  • Extras: Markdown escaping for dynamic fields; permission.asked notifies bound chats with once/always/reject buttons; drop_pending_updates: true on bot start.

CI

  • GitHub Actions on push/pull_request to main
  • Node 20 and 22 matrix (engines.node >= 20)
  • npm ci → syntax check → unit tests → OpenCode package validation → smoke import → npm pack --dry-run
  • Pure helpers extracted to src/util.js with node:test coverage

Test plan

  • CI green on this PR (Node 20 + 22)
  • With telegram.json configured, reload OpenCode and confirm the bot starts from a project directory (not only $HOME).
  • /current attaches to the last viewed / most recently updated session across projects.
  • Switch sessions via /sessions then reply in the old desktop session — phone should not receive that old session’s messages.
  • Prompt from phone and from desktop; each assistant text segment arrives once (no duplicates).
  • Agent turn with tools (text → tool → text) delivers both text segments.
  • /model lists models via API even when opencode.json has no per-model overrides.
  • Trigger a permission ask; Telegram shows buttons and once/always/reject works.
Open in Web Open in Cursor 

cursoragent and others added 3 commits October 30, 2026 08:36
Correct several V2 plugin bugs: unbind chats on session switch,
deliver session.text.ended using event text with ordinal keys,
share pending/delivered locks between event and wait fallback paths,
parse ctx.model.list() as { data }, resolve /current via session.viewed
plus order=desc, start the bot on any lock-winning location, escape
Markdown, and surface permission.asked with inline replies.

Co-authored-by: HenryYannis <HenryYannis@users.noreply.github.com>
Add Node 20/22 CI with syntax check, unit tests for binding/delivery
helpers, package convention validation, smoke import, and pack dry-run.
Extract pure helpers to src/util.js so CI can cover them without a live
OpenCode host.

Co-authored-by: HenryYannis <HenryYannis@users.noreply.github.com>
Bash does not expand ** without globstar, so Node 20 treated
test/**/*.test.js as a literal path. Use test/*.test.js instead.

Co-authored-by: HenryYannis <HenryYannis@users.noreply.github.com>
@cursor
cursor Bot merged commit fe3423c into main Oct 30, 2026
2 checks passed
@cursor
cursor Bot deleted the cursor/fix-telegram-plugin-bugs-ff64 branch October 30, 2026 08:58
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.

2 participants