Skip to content

chore(deprecate): per-channel conversation routing (FrameworkConfig.conversations) - #239

Merged
antra-tess merged 2 commits into
mainfrom
chore/deprecate-conversation-routing
Oct 7, 2026
Merged

antra-tess merged 2 commits into
mainfrom
chore/deprecate-conversation-routing

Conversation

@antra-tess

@antra-tess antra-tess commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Per-channel conversation routing (FrameworkConfig.conversations, ConversationRouter) is being retired.

Its bind/trigger 'mention' rule reads metadata.mentioned. discord-mcpl never sets that field: it sends isExplicitMention / isMention and the RFC-001 chat:mention tag. 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:

  • @deprecated annotations on FrameworkConfig.conversations, ConversationRouterConfig and ConversationRouter, with the reason. Their re-exports in src/index.ts and src/mcpl/index.ts are annotated too.
  • Deprecation warning: AgentFramework.create logs one [deprecated] line when conversations is set, once per framework instance. Spawning forks doesn't log again. The text lives in CONVERSATION_ROUTING_DEPRECATION_NOTICE in conversation-router.ts, which is not re-exported.
  • Doc fix: the idleTtlMs JSDoc now says expiry is checked at most about once a minute (the gate in sweepExpiredConversations). 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.
  • README: a short "Per-channel conversation routing (deprecated)" note under MCPL. The README had no section on the feature before.
  • Changelog fragment: changelog.d/deprecate-conversation-routing.changed.md.

Tests

  • New: 2 tests in test/conversation-routing.test.ts, reusing its setup:

    • configured: exactly one [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;
    • not configured: no line.

    The first fails when the console.warn is removed; the second guards the unchanged path.

  • Targeted: conversation-routing, conversation-router, conversation-fork-injection-scoping and trunk-channel-routing pass 45/45 on each of 3 runs.

  • Full suite: npm run typecheck and npm run build are 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). On main the file exits before that fires. Adding any test after it reproduces the failure on unmodified main. I left that test alone.

Companion PRs

anima-research/connectome-host#206 deprecates the recipe conversations block 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 sets conversations gets two lines: the host's, which names the recipe key, and this one.

🤖 Generated with Claude Code

…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>
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5 Tier: apex

[Low risk] Marks per-channel conversation routing as deprecated.

The PR appears safe to merge; the earlier cleanup-timing wording is fixed.

Summary

Deprecates per-channel conversation routing without changing how messages route.

  • Adds deprecation notes and one startup warning when FrameworkConfig.conversations is set.
  • Adds tests for configured and unconfigured startup paths.
  • Fixes the cleanup wording flagged in the previous review.

Reviews (2) · Last reviewed commit: "docs(conversations): ~60s is the usual s..." · Reviewed by Greptile

Comment thread src/mcpl/conversation-router.ts Outdated
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>
antra-tess added a commit to anima-research/connectome-host that referenced this pull request Oct 6, 2026
…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>
@antra-tess

Copy link
Copy Markdown
Collaborator Author

Note for the removal follow-up: #200 (now merged) added AgentFramework.mayTakeGateRoute. It keeps a batched gate wake's addressed route away from forks bound to another channel, and away from the trunk when a fork owns that channel. It should go when the feature does. The same follow-up can drop the open gap discussed in the #200 thread: the gate broadcasts every wake to forks and to the trunk, whoever owns the channel.

Re-checked against main at 038b01f (with #200): clean merge, typecheck clean. The conversation-routing, router, fork-injection-scoping, trunk-channel-routing, batched-wake-locus, turn-trigger-provenance and event-gate tests pass 103/103.

@antra-tess
antra-tess merged commit 64c480b into main Oct 7, 2026
5 checks passed
@antra-tess

Copy link
Copy Markdown
Collaborator Author

@greptileai please re-review at the current head (d4dafcc).

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