Repository navigation
chore(deprecate): per-channel conversation routing (FrameworkConfig.conversations) - #239
Conversation
…onversations) Per-channel conversation routing is being retired (#235). Its 'mention' bind/trigger rule, the default for channels, reads metadata.mentioned, which discord-mcpl never sets, so on Discord channels an @-mention neither binds a fork nor triggers a bound one. Rather than extend the contract, the feature is deprecated; removal is a follow-up. Behavior is unchanged. FrameworkConfig.conversations, ConversationRouterConfig, ConversationRouter and their re-exports carry @deprecated, and AgentFramework.create logs one [deprecated] line when conversations is set. The idleTtlMs docs now say expiry is checked at most about once a minute (~60s granularity). README and a changelog fragment mark the feature deprecated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The idle sweep keeps running while the host is quiesced: it unbinds the channel, but the closure turn stays queued until resume, so a fork can outlive idleTtlMs + ~60s by much more. Describe ~60s as the usual extra delay before the sweep notices expiry, not a deadline for closing the fork. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…line Match anima-research/agent-framework#239: the idle sweep usually notices an expired binding up to ~60s after idleTtlMs, but the fork's closure turn can be delayed further (e.g. it stays queued while the host is quiesced). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note for the removal follow-up: #200 (now merged) added Re-checked against |
|
@greptileai please re-review at the current head (d4dafcc). |
Why
Per-channel conversation routing (
FrameworkConfig.conversations,ConversationRouter) is being retired.Its bind/trigger
'mention'rule readsmetadata.mentioned. discord-mcpl never sets that field: it sendsisExplicitMention/isMentionand the RFC-001chat:mentiontag. Channels default to'mention'for both bind and trigger, so on Discord channels an @-mention never binds a fork and never triggers a bound one (#235, F5).Rather than extend the contract with another mention source, the decision is to deprecate the feature. Removal is left for a follow-up.
For context, two open fixes target this feature: #206 (for #44) and #212 (for #47).
Refs #235
What this does
Behavior is unchanged. Routing, fork spawning, idle expiry and generation persistence all work as before. Remaining uses become visible:
@deprecatedannotations onFrameworkConfig.conversations,ConversationRouterConfigandConversationRouter, with the reason. Their re-exports insrc/index.tsandsrc/mcpl/index.tsare annotated too.AgentFramework.createlogs one[deprecated]line whenconversationsis set, once per framework instance. Spawning forks doesn't log again. The text lives inCONVERSATION_ROUTING_DEPRECATION_NOTICEinconversation-router.ts, which is not re-exported.idleTtlMsJSDoc now says expiry is checked at most about once a minute (the gate insweepExpiredConversations). The sweep usually notices an expired binding up to ~60s after the TTL (Campaign A live validation (10/1–10/3 drops): architecture held; 1 enforcement defect (time limits vs blocking code), 2 seam gaps, 1 integration bug, 1 design question #235). That is the usual extra delay, not a deadline for closing the fork: the closure turn can be delayed further, e.g. it stays queued while the host is quiesced.changelog.d/deprecate-conversation-routing.changed.md.Tests
New: 2 tests in
test/conversation-routing.test.ts, reusing its setup:[deprecated]line at creation. A DM and a channel mention each still spawn a fork and run inference, and there is still exactly one line afterwards;The first fails when the
console.warnis removed; the second guards the unchanged path.Targeted:
conversation-routing,conversation-router,conversation-fork-injection-scopingandtrunk-channel-routingpass 45/45 on each of 3 runs.Full suite:
npm run typecheckandnpm run buildare clean.npm test: 1230 tests, 1226 pass, 0 fail, 4 skipped.Why the new tests sit mid-file: appended at the end of the file, they expose a pre-existing leak. The current last test ("fork channel_publish: …") stops its framework while a stubbed tool call is still in flight. The late result then hits the closed queue (
Queue is closed, unhandled rejection). Onmainthe file exits before that fires. Adding any test after it reproduces the failure on unmodifiedmain. I left that test alone.Companion PRs
anima-research/connectome-host#206 deprecates the recipe
conversationsblock that feeds this config, with its own startup line. Neither PR depends on the other, so they can merge in either order. Once the host picks up an AF release with this change, a recipe that setsconversationsgets two lines: the host's, which names the recipe key, and this one.🤖 Generated with Claude Code