You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sessions store a frozen agent_snapshot at create-time so the agent's behavior
stays consistent across the session even if the user edits the agent config
mid-conversation. SessionDO reads agent_snapshot (apps/agent/src/runtime/session-do.ts:399-402)
preferentially over a live DB lookup.
For Slack publish (and Linear/GitHub publish), the integrations gateway
augments the snapshot with the integration's MCP server URL + an mcp_toolset
declaration via injectMcpServersIntoSnapshot (apps/main/src/routes/internal.ts).
Bug
The augmentation runs ONLY on sessions.create. When a webhook event arrives
for an existing scope-bound session (per_channel for Slack, per_issue for
GitHub/Linear), the dispatch path calls sessions.resume(...) which just
appends the event — no snapshot mutation.
Consequence: if the publish wiring or the agent's MCP server set changes
between creates, active sessions never see the change. We hit this
2026-05-19 when the missing mcp_toolset injection was added — existing
slack-bound sessions kept telling users to run curl commands until their slack_thread_sessions row was manually flipped to inactive.
Options for fix
Detect drift on resume. Before resume, compare the session's agent_snapshot.mcp_servers against the publication's currently-required
set; if drifted, mark the scope row inactive and create a fresh session.
Loses the running thread context but no model gets stuck.
Mid-session snapshot patch. Add a sessions.augmentSnapshot() op that
writes additive changes (new mcp_toolset, new mcp_servers) without
replacing the whole snapshot. Preserves thread context. Risk: harder to
reason about (now the snapshot mutates between turns).
Pre-flight at publish time. Refuse oma slack bind (and equivalents)
when the agent's tools[] doesn't already declare an mcp_toolset for the
integration's server. Removes the silent-divergence class of bugs entirely
at the cost of more upfront UX. Composes well with docs: add CONTRIBUTING.md #1.
I lean (3) + (1).
Repro
Publish agent A to Slack channel C — first @mention creates session S
with snapshot S0 (lacking mcp_toolset for slack at the time, before
today's fix).
Deploy a fix that adds the toolset at create-time.
@mention A in C again — S resumes. S0 still drives behavior.
Out of scope
The frozen-snapshot design itself for in-conversation agent edits is fine
by design. This issue is specifically about publish-side wiring drift.
Background
Sessions store a frozen
agent_snapshotat create-time so the agent's behaviorstays consistent across the session even if the user edits the agent config
mid-conversation. SessionDO reads
agent_snapshot(apps/agent/src/runtime/session-do.ts:399-402)preferentially over a live DB lookup.
For Slack publish (and Linear/GitHub publish), the integrations gateway
augments the snapshot with the integration's MCP server URL + an
mcp_toolsetdeclaration via
injectMcpServersIntoSnapshot(apps/main/src/routes/internal.ts).Bug
The augmentation runs ONLY on
sessions.create. When a webhook event arrivesfor an existing scope-bound session (per_channel for Slack, per_issue for
GitHub/Linear), the dispatch path calls
sessions.resume(...)which justappends the event — no snapshot mutation.
Consequence: if the publish wiring or the agent's MCP server set changes
between creates, active sessions never see the change. We hit this
2026-05-19 when the missing
mcp_toolsetinjection was added — existingslack-bound sessions kept telling users to run curl commands until their
slack_thread_sessionsrow was manually flipped toinactive.Options for fix
Detect drift on resume. Before
resume, compare the session'sagent_snapshot.mcp_serversagainst the publication's currently-requiredset; if drifted, mark the scope row inactive and create a fresh session.
Loses the running thread context but no model gets stuck.
Mid-session snapshot patch. Add a
sessions.augmentSnapshot()op thatwrites additive changes (new mcp_toolset, new mcp_servers) without
replacing the whole snapshot. Preserves thread context. Risk: harder to
reason about (now the snapshot mutates between turns).
Pre-flight at publish time. Refuse
oma slack bind(and equivalents)when the agent's tools[] doesn't already declare an mcp_toolset for the
integration's server. Removes the silent-divergence class of bugs entirely
at the cost of more upfront UX. Composes well with docs: add CONTRIBUTING.md #1.
I lean (3) + (1).
Repro
with snapshot S0 (lacking mcp_toolset for slack at the time, before
today's fix).
Out of scope
by design. This issue is specifically about publish-side wiring drift.