Skip to content

Make the bound chat one mechanism: a type supplies its describer, skill and options (closes #3741) - #3756

Merged
malibio merged 2 commits into
mainfrom
issue-3741-bound-chat-mechanism
Oct 12, 2026
Merged

malibio merged 2 commits into
mainfrom
issue-3741-bound-chat-mechanism

Conversation

@malibio

@malibio malibio commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Implements ADR-100 §1 and §2.

  • One service operation (open_bound_chat), one RPC (OpenBoundChat), one Tauri command and one frontend call (openBoundChat) replace the play-only ones, which are removed.
  • A type takes part by supplying a BoundChatType: noun, skill, changes and a describer. It is resolved through the type registry (core_type_of + is_a), so a subtype takes part with its ancestor's. A type that supplies none is refused with a clear error.
  • The mechanism writes the explain option first and the closing question, so explaining is first for every type by construction. No model call.
  • The play is the first case; its description, options, pins and routing are unchanged.
  • Viewers offer the chat through one component, bound-chat-button.svelte.

Docs: nodespace-docs architecture/ai-chat-node.md updated on main.

Tests: bound_chat unit tests (participating type, refused type, explain-first by construction, play end to end), local_agent_service routing tests, and frontend tests. bun run test:changed passes.

🤖 Generated with Claude Code

@malibio

malibio commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator Author

Pragmatic code review: APPROVE

Review type: Initial (no prior reviews or comments).

Requirements check (issue #3741)

  • One service op / RPC / frontend call, play-specific ones removed: met. open_bound_chat, OpenBoundChat, local_agent_open_bound_chat, /api/agent/bound-chat, localAgentOpenBoundChat, aiChatsData.openBoundChat. A repo grep finds no remaining play_edit_chat / CreatePlayEditChat / play-edit-chat / EDIT_OPTIONS outside test-helper names in agent_loop.rs. No shims.
  • Type supplies describer + skill + options, unsupported type refused: met (BoundChatType, BoundChatError::NotSupported -> invalid_argument).
  • No model call for the opening message: met (system-written via append_message; existing test asserts the engine is not called).
  • Explain first by construction: met (BoundChatType::options prepends it; changes cannot contain it).
  • Play behaviour unchanged: met. Same describer text, same options order, same Edit <title> / Untitled play fallbacks, same pins, same error-to-status mapping. Routing is word-based and reads the offered options from the stored message, so it is untouched.
  • Tests: play end to end, non-participating type, a synthetic second type for options/opening message: present.
  • Registry resolution: core_type_of + CoreNodeType::is_a, no node_type == "<literal>" in product code. Subtypes of a participant take part.
  • No CLI input/output change, so SKILL.md is not affected. No node type/field change, so node-types.md is not affected. ai-chat-node.md already describes the mechanism.

Findings

Critical Issues

None.

Suggested Improvements

  • packages/daemon/src/services/bound_chat.rs tests: the "type that takes part" case with a second type exercises only options() / opening_message(), not open_bound_chat -> bound_chat_type. Nothing proves a subtype of play (extends) is accepted, which is the stated reason for is_a. Cheap to add if a test subtype can be registered; otherwise fine to defer to the first real second participant.

Nitpicks

  • Nit: packages/desktop-app/src/lib/components/chat/bound-chat-button.svelte: the <Button ...> opening tag is ~104 chars on one line; bun run quality:fix will reflow it. Same for the localAgentOpenBoundChat mock in src/tests/stores/ai-chats.test.ts, which now fits on one line.
  • Nit: the new BoundChatButton is covered only through play-node-viewer.test.ts. A tiny dedicated test (label prop, error bind) would keep it covered when a second viewer adopts it.
  • Nit: ai-chats.test.ts failure case still uses the string play play-1 not found; harmless, but a neutral message would match the now-generic API.

Recommendation

APPROVE. Clean, atomic replacement with no compatibility paths; play behaviour preserved. The only item worth considering is the subtype-participation test.

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.

@malibio

malibio commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the review (APPROVE with improvements and nits):

  • Addressed: subtype participation is now tested end to end (a play subtype resolves through the registry and gets the chat); BoundChatButton has its own test; Prettier reflow; the store test's error string no longer says play.
  • Skipped: none.

Only tests and formatting changed, no product logic. Re-review not needed.

malibio and others added 2 commits October 12, 2026 10:13
…ll and options (closes #3741)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…t, format

- A play subtype gets the chat with its ancestor's describer, skill and options
- BoundChatButton has its own test
- Prettier reflow; the store test's error string no longer says play

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@malibio
malibio force-pushed the issue-3741-bound-chat-mechanism branch from d3311c5 to 5b72f0e Compare October 12, 2026 08:13
@malibio
malibio merged commit fc7dc37 into main Oct 12, 2026
@malibio
malibio deleted the issue-3741-bound-chat-mechanism branch October 12, 2026 08:13
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