8000 refactor(adapters)!: remove respondToolResult; share message builder and queue map by geminixiang · Pull Request #198 · geminixiang/mikan · GitHub
[go: up one dir, main page]

Skip to content

refactor(adapters)!: remove respondToolResult; share message builder and queue map - #198

Merged
geminixiang merged 3 commits into
mainfrom
refactor/simplify-adapters
Oct 26, 2026
Merged

geminixiang merged 3 commits into
mainfrom
refactor/simplify-adapters

Conversation

@geminixiang
Copy link
Copy Markdown
Owner

Stage 2 of docs/research/simplify-modules-2026-10.md (#196). 33 files, +211 / −322.

Change Note
Remove ConversationResponder.respondToolResult, ChatToolResult, and the per-platform tool-result formatters No production caller since afda4ab
createEventMessage in shared.ts for Discord, GitHub, Telegram Telegram keeps deriveSessionKey; Discord and GitHub keep the persistent-top-level key. Clone budget discord↔github → 0
MessagingQueueMap replaces four getQueue copies Slack still closes a queue created after stop() and does not await close() (ADR 0027); 4 new unit tests
Slack handleAppMention / handleMessageEvent share dispatchIncoming; session key computed once Ack order, task control before the Jev auto-reply check, and each handler's pre-startup log wording unchanged
Discord/Telegram stop/enqueueEvent/log helpers Skipped: no clone above the threshold, and the two stops differ in awaiting

Compatibility

Breaking for embedders: ConversationResponder.respondToolResult and the exported ChatToolResult type are removed. A responder that imports ChatToolResult or is an object literal typed as ConversationResponder with that method fails to compile; delete the method. deploy/examples/embedder is updated. Needs a release-note line.

Verification

Check main branch
npm run typecheck pass pass
npm test 2033 passed 2034 passed (−3 dead-path tests, +4 queue-map tests)
npm run duplication 1 clone 0 clones
Pre-commit gate pass pass

Eval: existing tests, typecheck, and source guards serve as the before/after baseline, as agreed for behavior-preserving refactors.

Pending: this changes the Slack intake path, so slack-e2e.yml must pass before merge. Draft until then.

@geminixiang
geminixiang commented Oct 26, 2026 •
Copy link
Copy Markdown
Owner Author

Slack E2E passed 26/26 on this branch (run 40300808883).

…thod

No production code has called ConversationResponder.respondToolResult since afda4ab, so the method, the ChatToolResult type, each platform's tool-result formatter, and the renderer's formatToolResult hook were dead code.

BREAKING CHANGE: ConversationResponder no longer declares respondToolResult and the package no longer exports ChatToolResult. Embedders that implement ConversationResponder should delete their respondToolResult method and any ChatToolResult import (deploy/examples/embedder is updated).
…rge Slack intake

createEventMessage in shared.ts builds a platform message from an event.
Telegram passes deriveSessionKey; Discord and GitHub pass
persistentTopLevelSessionKey. The discord/github clone budget drops to zero.

MessagingQueueMap replaces the four getQueue copies and keeps Slack's rules
from ADR 0027: a queue created after stop is closed, and Slack's stop does
not wait for its queues to drain.

Slack's app_mention and message handlers share one dispatch tail with the
session key computed once, keeping ack order, the Jev auto-reply check after
task control, and each handler's pre-startup log wording.
@geminixiang
geminixiang force-pushed the refactor/simplify-adapters branch from 875c141 to 76935b3 Compare October 26, 2026 10:48
@geminixiang
geminixiang merged commit 8d1f4a3 into main Oct 26, 2026
6 checks passed
@geminixiang
geminixiang deleted the refactor/simplify-adapters branch October 26, 2026 10:52
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.

1 participant

0