Skip to content

directive-over-SEP + image-through-SEP (additive)#236

Merged
brentrager merged 1 commit into
mainfrom
SMOODEV-copilot-sep-gaps
Jul 16, 2026
Merged

directive-over-SEP + image-through-SEP (additive)#236
brentrager merged 1 commit into
mainfrom
SMOODEV-copilot-sep-gaps

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Context

Unblocks the ADR-092 copilot convergence (SmooAI monorepo). Two capabilities work on api-prime's REST run_turn but were dropped on the streaming SEP path: the client directive (navigate/apply_view) tools return, and image input (business-card photo). Adding both, additively.

directive-over-SEP

Reuses the existing citation-sink pattern — a directive_sink: Arc<Mutex<Value>> on ToolProviderContext (facade), drained after the turn into TurnResult.directive, emitted on eventual_response only when a host tool wrote one (omitted otherwise → back-compat). No core release: on this crate nothing writes the sink (it stays null → directive always None), so the wire is unchanged until the monorepo's CoreToolAdapter writes the tool's directive into the sink after the pin bump.

image-through-SEP

send_message gains optional images[]; TurnRequest.images (Vec<UserImage>) threads to AgentConfig::with_user_images (the vision LLM) and ToolProviderContext.images (so a host tool's ToolCtx.images sees it — the crm.scan_business_card path). Core 0.16.2 already has with_user_images/ImageContent (verified). Handler parses images fail-soft (malformed/absent → empty, never rejects the turn).

Additive / back-compat

images/directive are optional (not in required), old clients skip them, TurnRequest.images defaults empty (text-only unchanged). spec/ schemas + regenerated TS SDK types (SendMessageRequest.images?, EventualResponse.directive?).

Verification

  • cargo build/test green for smooth-operator-server + smooth-operator (new eventual_response directive tests + context builder tests); cargo build --workspace green; changed files clippy-clean; cargo fmt clean.
  • TS generate + typecheck green.
  • Single MINOR changeset (repo lockstep-stamps all crates via sync-versions.mjs).

⚠️ Pre-release follow-ups

  1. Go/Python/.NET SDK regen — only the TS SDK regenerated here; run the polyglot parity tooling before release if needed.
  2. Pre-existing clippy debt (sort_by in adapters/in-memory + dynamodb) is red under local clippy 1.96 — not touched by this PR, present on main (no rust-toolchain.toml pin).

After publish (monorepo)

Bump smooai-smooth-operator{,-server} + npm SDK pins; CoreToolAdapter writes the tool's data.directive into ToolProviderContext.directive_sink + threads ctx.imagesToolCtx.images; copilot-ws sets TurnRequest.images from the SEP images. That lights up copilot nav + business-card scanning on smooth-operator.smoo.ai.

🤖 Generated with Claude Code

Unblocks the ADR-092 copilot convergence P3 — the two capabilities that work on
api-prime's REST run_turn but not on the streaming SEP path.

directive-over-SEP: tools return a client Directive (navigate/apply_view) that the
streaming eventual_response dropped. Reuse the citation-sink pattern — a
directive_sink Arc<Mutex<Value>> on ToolProviderContext (facade), drained after the
turn into TurnResult.directive, emitted on eventual_response ONLY when a host tool
wrote one (omitted otherwise → back-compat). No core release: the monorepo's
CoreToolAdapter writes the tool's directive into the sink after the pin bump.

image-through-SEP: send_message gains optional images[]; TurnRequest.images (Vec<
UserImage>) threads to AgentConfig::with_user_images (the vision LLM) AND
ToolProviderContext.images (so a host tool's ToolCtx.images sees it — the
crm.scan_business_card path). Core 0.16.2 already has with_user_images/ImageContent
(verified). handler parses images fail-soft.

All additive: images/directive are optional (not in `required`), old clients skip
them, TurnRequest.images defaults empty (text-only unchanged). spec/ schemas +
regenerated TS SDK types. Single MINOR changeset (repo lockstep-stamps all crates).

Verified: server + facade build/test green (new eventual_response directive tests +
context builder tests); workspace builds; changed files clippy-clean; TS generate +
typecheck green.

Follow-ups (pre-release): Go/Python/.NET SDK regen (only TS done here); monorepo
consumes after publish (pin bump + CoreToolAdapter writes directive_sink + threads
ctx.images → ToolCtx.images + copilot-ws sets TurnRequest.images).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WEUZgsyfGVab8uqSFPbr23
@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e00b4f3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@smooai/smooth-operator Minor
@smooai/smooth-operator-web-chat-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brentrager
brentrager merged commit d3d3abe into main Jul 16, 2026
7 checks 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