feat: Add workspace-level chat#931
Draft
adavyas wants to merge 4 commits into
Draft
Conversation
POST /v3/workspaces/{workspace_id}/chat: agentic dialectic over the whole
workspace instead of a single (observer, observed) pair. Salvaged from
#373 and re-grown on today's DialecticAgent:
- WorkspaceDialecticAgent subclasses DialecticAgent via four new seams
(_get_tools, _create_tool_executor, _prefetch_intro, _trace_name) instead
of a base-class extraction; observer/observed use empty-string sentinels.
- Routing-accelerated prefetch: workspace stats + top-5 active peers with
their self peer-cards (pure DB, ~7ms measured) so routing-obvious queries
resolve without a discovery tool round.
- Observation search stays pair-scoped (matches per-pair vector namespaces;
avoids workspace-flat top-k dilution): search_memory/get_peer_card take
observer/observed as tool arguments, with pair attribution in results.
- workspace_chat / workspace_chat_stream orchestrators, WorkspaceChatOptions
schema (scope param seam left for the #897 scopes facade), SSE streaming,
structured output via response_format.
- crud: get_workspace_stats, get_active_peers; format_documents_with_attribution.
- SDKs: Python Honcho.chat/chat_stream + HonchoAio mirrors; TypeScript
honcho.chat/chatStream.
- 46 tests (route, orchestrator preflight, tool handlers, executor routing,
attribution formatting) + unified test cases + docs.
Co-Authored-By: doria <93405247+dr-frmr@users.noreply.github.com>
Co-Authored-By: Benjamin McCormick <docterformer@protonmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…nWarnings) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Restores docs/v3/documentation/features/chat.mdx to main's version. This also puts back the peer-chat Structured Outputs section (#896) that the workspace-chat commit removed as a rebase artifact. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
POST /v3/workspaces/{workspace_id}/chat— agentic dialectic over the whole workspace instead of a single (observer, observed) pair. Successor to #373, salvaged and re-grown on today'sDialecticAgent.Closes DEV-1326.
Design
WorkspaceDialecticAgentsubclassesDialecticAgentthrough four small seams added to the base class (_get_tools,_create_tool_executor,_prefetch_intro,_trace_name) rather than feat: workspace-level chat #373's base-class extraction — the pair agent's hot path is untouched.search_memory/get_peer_cardtakeobserver/observedas tool arguments, delegate to the existing pair handlers via ahandler_resolverseam oncreate_tool_executor, and results carry[observer->observed]attribution so multi-pair turns don't conflate.session_idnarrows message tools to one session. Thescoperead option from the scopes work (Scopes Phase 2b:scopeoption on chat, representation, context, and search #897) has a marked seam inWorkspaceChatOptionsand lands as a follow-up once the scopes facade merges.Honcho.chat/chat_stream(+HonchoAiomirrors), TypeScripthoncho.chat/chatStream. SSE streaming andresponse_formatstructured output supported, mirroringpeer.chat.Salvaged from #373 (co-authored)
crud
get_workspace_stats/get_active_peers, workspace tool JSON defs, workspace system prompt,format_documents_with_attribution, test suite + unified test cases, docs page, TS SDK surface. #373's temporal-visibility fix is not needed — main already gates by session membership windows (crud/message.py).Verification
tests/test_workspace_chat.py: 46/46 (route, orchestrator preflight session-release, tool handlers, executor routing, attribution formatting)tests/crud/test_document.pydedup tests that fail identically on clean main (pre-existing flake) — TS SDK build+typecheck passNotes
search_workspace(require_auth(workspace_name="workspace_id")); Prometheusrecord_dialectic_callwired; Langfuse trace nameworkspace_chat, telemetry agent_typeworkspace_dialectic.🤖 Generated with Claude Code