Skip to content

connect: open watch-only when the server says a session takes no prompts#78

Merged
hbrooks merged 1 commit into
mainfrom
steer-conversations-on-their-surface
Jul 24, 2026
Merged

connect: open watch-only when the server says a session takes no prompts#78
hbrooks merged 1 commit into
mainfrom
steer-conversations-on-their-surface

Conversation

@hbrooks

@hbrooks hbrooks commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

A mention session (Slack, GitHub, or Linear) is a durable keyed conversation, so the old local rule in connectability ("keyed and not closed") treated it as sendable and opened a composer. But a mention agent posts every answer back to the surface it was mentioned on, so a message typed here would be answered in a thread that never showed the question. The backend now refuses these sends with 409, so without this change the composer opens and fails on the first Enter.

connectability now reads the server's prompting projection, the same one POST /messages enforces, so the composer opens exactly where a send would land:

Session Before After
Slack / GitHub / Linear mention composer (send would 409) watch-only, "This conversation lives on Slack. Reply there..."
react / cron composer (send would 409) watch-only
you started it (CLI / API / dashboard) composer composer

Two deliberate choices:

  • detail is rendered verbatim rather than switching on blocked_reason, so a refusal reason added server-side reads correctly with no CLI release.
  • Servers predating the field fall back to the previous keyed/closed read, so an upgraded binary still behaves correctly against an older backend.

One seam covers both entry points: agent session connect and the multi-session UI already share connectability.

Requires @ellipsis-dev/sdk 0.2.3, which exports SessionPrompting; dep bumped from ^0.2.0.

Test plan

  • bun run typecheck against the SDK's generated SessionPrompting
  • bun run test - 283 passed, including 4 new cases: honors the projection over the local read, sends when enabled, falls back when the field is absent, generic copy when detail is null
  • bun run build + bun build --compile + agent --version (the remaining CI gates)
  • Drove connectability with a mention-session payload as the API returns it: opens watch-only with the server's sentence, while self-started and pre-field sessions keep the composer

A Slack mention session is keyed and live, so the old local rule ("keyed and
not closed") called it sendable and opened a composer. But a mention agent
posts every answer back to its surface, so a message typed here would be
injected and then answered in a Slack thread that never showed the question
(prod session_WOcLHUAK..., 2026-07-24). The send now 409s server-side, which
would have surfaced as a failed Enter.

connectability reads the server's `prompting` projection instead: the SAME one
POST /messages enforces, so the composer opens exactly where a send would land.
Its `detail` is rendered verbatim, so a new refusal reason reads correctly with
no CLI release. Servers predating the field fall back to the previous
keyed/closed read, so an upgraded binary still works against an older backend.

One seam covers both entry points: `agent session connect` and the
multi-session UI already share connectability.

Requires @ellipsis-dev/sdk 0.2.3, which exports SessionPrompting.
@hbrooks
hbrooks merged commit 7d0d24b into main Jul 24, 2026
1 check passed
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