Conversation
…conversational field Add comprehensive documentation for chat agent features and workflow automation system. Remove deprecated 'conversational' configuration from LLM nodes across UI and backend.
📝 WalkthroughWalkthroughThis pull request adds comprehensive documentation for the Chat Agent and Workflow System features by introducing two new guide files (docs/chat-agent-guide.md and docs/workflow-guide.md) and updating the README with a Documentation section. Additionally, the conversational property is systematically removed from the LLM step configuration across the codebase, including the default template in create-step-dialog.tsx, the schema in step-details-dialog.tsx, validation in nodes.ts, and references in documentation strings and type definitions. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro (Legacy)
📒 Files selected for processing (7)
README.md(1 hunks)docs/chat-agent-guide.md(1 hunks)docs/workflow-guide.md(1 hunks)services/platform/app/(app)/dashboard/[id]/automations/components/create-step-dialog.tsx(0 hunks)services/platform/app/(app)/dashboard/[id]/automations/components/step-details-dialog.tsx(0 hunks)services/platform/convex/agent_tools/convex_tools/workflows/update_workflow_step_tool.ts(0 hunks)services/platform/convex/workflow/types/nodes.ts(0 hunks)
💤 Files with no reviewable changes (4)
- services/platform/convex/workflow/types/nodes.ts
- services/platform/app/(app)/dashboard/[id]/automations/components/create-step-dialog.tsx
- services/platform/app/(app)/dashboard/[id]/automations/components/step-details-dialog.tsx
- services/platform/convex/agent_tools/convex_tools/workflows/update_workflow_step_tool.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*
📄 CodeRabbit inference engine (.cursor/rules/workspace_rules.mdc)
Use English only for ALL user-facing content including UI components, labels, buttons, dialogs, forms, toast messages, error messages, success messages, comments, documentation, README files, variable names, function names, and type names
Files:
docs/workflow-guide.mddocs/chat-agent-guide.mdREADME.md
🪛 Gitleaks (8.30.0)
docs/workflow-guide.md
[high] 1109-1109: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
🪛 LanguageTool
docs/workflow-guide.md
[style] ~102-~102: ‘connected together’ might be wordy. Consider a shorter alternative.
Context: ...re A workflow is a series of steps connected together. Each step does one thing, then passes ...
(EN_WORDINESS_PREMIUM_CONNECTED_TOGETHER)
🪛 markdownlint-cli2 (0.18.1)
docs/workflow-guide.md
27-27: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
63-63: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
64-64: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
70-70: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
71-71: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
77-77: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
78-78: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
84-84: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
85-85: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
91-91: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
92-92: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
106-106: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
159-159: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
168-168: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
172-172: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
178-178: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
186-186: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
226-226: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
255-255: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
256-256: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
298-298: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
299-299: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
314-314: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
478-478: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
479-479: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
495-495: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
538-538: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
544-544: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
550-550: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
556-556: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
610-610: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
702-702: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
786-786: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
859-859: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
910-910: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
937-937: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
1065-1065: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1069-1069: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1070-1070: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
1078-1078: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1082-1082: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1086-1086: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1090-1090: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1091-1091: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
1100-1100: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1101-1101: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
1106-1106: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1107-1107: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
1115-1115: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1116-1116: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
1124-1124: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1125-1125: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
1136-1136: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1137-1137: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
1163-1163: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1164-1164: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
1170-1170: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1171-1171: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
1178-1178: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1179-1179: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
1187-1187: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
docs/chat-agent-guide.md
9-9: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
17-17: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
23-23: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
31-31: Bare URL used
(MD034, no-bare-urls)
57-57: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
63-63: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
75-75: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
80-80: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
85-85: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
90-90: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
103-103: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
131-131: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
136-136: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
140-140: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
178-178: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
183-183: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
188-188: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
193-193: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
🔇 Additional comments (3)
docs/workflow-guide.md (1)
1-1218: Documentation is comprehensive and well-aligned with feature set.The guide accurately reflects the workflow system, including the removal of conversational context controls (no
conversationalfield documented), proper variable syntax, threadId-based memory sharing, and practical patterns. Content is clear, examples are actionable, and best practices are well-presented.docs/chat-agent-guide.md (1)
1-222: Documentation accurately reflects chat agent capabilities and removal of conversational field.The guide comprehensively covers chat agent features, practical use cases, and best practices. It correctly does not document the deprecated
conversationalfield (per PR changes), focusing instead on the current feature set including natural conversation, knowledge base search, workflow automation, and file operations. Content is clear, well-organized, and helpful for end users.README.md (1)
140-145: Documentation section integrates smoothly and clearly guides users to new guides.The new section provides clear entry points to both the Chat Agent and Workflow guides with concise, action-oriented descriptions. Links are correct, and placement is logical within the README structure.
- Fix markdown formatting violations (MD022, MD031, MD036, MD040) - Add blank lines before/after headings and code blocks - Add language specifiers to fenced code blocks - Convert emphasis (**bold**) to proper heading syntax (####) - Fix wordy phrasing: 'connected together' -> 'connected in sequence' - Obfuscate API key example: 'sk_live_abc123' -> 'your-api-key' - Wrap bare email in code backticks
…inding Five clustered cross-tenant + IDOR P0s flagged by the two-round data-protection review (round-1 #5, #16, #17, #27, round-2 V1, V7, V8): P0-1, P0-2: generic admin-trash restore `restoreRowToActive` (soft_delete_helpers) added required `organizationId` arg + `userMembershipIds` set; refuses cross-org rows with `not_found` (no foreign-id existence oracle) and rows whose author is on a custodian hold. Added `authorField` to `SOFT_DELETE_RESOURCE_CONFIG` per resource type so the cascade fires uniformly across the 14 restorable types. `restoreSoftDeletedRow` (governance/restore.ts) threads holds + orgId. P0-3, P0-4: REST cross-tenant on GET/PATCH/DELETE Added optional `callerOrgId` arg to every internal query/mutation reachable from REST: threads (`getThreadMetadata`, `getThreadMessagesInternal`), customers (get/update/delete), vendors (get/update/delete), products (get/update/delete), documents (getDocumentByIdRaw, updateDocument, deleteDocumentById), workflow executions (getExecution, getRawExecution, listExecutionsCursorInternal, getExecutionStepJournalInternal), workflow triggers (cancelExecutionInternal, updateScheduleInternal, deleteScheduleInternal, deleteWebhookInternal). Each REST handler passes `rc.org.organizationId`. Mismatches return null/empty (so REST surfaces 404) — never throw cross-tenantly to avoid leaking row existence. P0-5: rag_search IDOR + thread-binding Architectural change: chat uploads bind to their thread at upload time. - file_metadata schema: new optional `threadId` + composite index `by_organizationId_and_threadId`. - file_metadata.saveFileMetadata: accepts threadId; refuses cross-org threadId via threadMetadata lookup. - chat-input upload hook: passes the current chat threadId. - New helpers: `threads/get_thread_ancestor_chain.ts` (action-side walk of the delegation chain via existing `getParentThreadId`), `agent_tools/rag/helpers/verify_thread_scoped_access.ts` (query that same-org-checks each storageId, then if `meta.threadId` is set, requires it in the caller's accessible chain). - rag_search search-op: when explicit fileIds are supplied, verify via the new query (replaces unauthenticated short-circuit). - rag_search retrieve-op: replaces commit d7bc3da's stricter "agent allow-list" check, which over-strictly blocked legitimate chat-upload retrieval (chat uploads never appear in the agent's pre-configured `knowledgeFileIds`/`agentTeamId`/`includeOrgKnowledge` sets). Same-org + thread-scope is the correct invariant. Cascade integration: - threads/cascade_helpers.ts: deletes bound fileMetadata + storage blobs as part of thread hard-delete (Pass B / GDPR erasure path). RAG-side fan-out is deferred to commit 4 (P0-13). - threads/delete_chat_thread.ts (Pass A trash): cascades soft-delete to bound fileMetadata rows (lifecycleStatus='trashed', mirrors grace-extension defense). - threads/restore_chat_thread.ts: cascades restore to fileMetadata rows trashed within ±5s skew of the thread's trash time (avoids zombie-restoring files that were independently trashed earlier). Verified: `bun typecheck` clean; 871 tests across affected areas pass. Regression tests for the new gates land in commit 6 (test guards) per the bundle plan.
…inding Five clustered cross-tenant + IDOR P0s flagged by the two-round data-protection review (round-1 #5, #16, #17, #27, round-2 V1, V7, V8): P0-1, P0-2: generic admin-trash restore `restoreRowToActive` (soft_delete_helpers) added required `organizationId` arg + `userMembershipIds` set; refuses cross-org rows with `not_found` (no foreign-id existence oracle) and rows whose author is on a custodian hold. Added `authorField` to `SOFT_DELETE_RESOURCE_CONFIG` per resource type so the cascade fires uniformly across the 14 restorable types. `restoreSoftDeletedRow` (governance/restore.ts) threads holds + orgId. P0-3, P0-4: REST cross-tenant on GET/PATCH/DELETE Added optional `callerOrgId` arg to every internal query/mutation reachable from REST: threads (`getThreadMetadata`, `getThreadMessagesInternal`), customers (get/update/delete), vendors (get/update/delete), products (get/update/delete), documents (getDocumentByIdRaw, updateDocument, deleteDocumentById), workflow executions (getExecution, getRawExecution, listExecutionsCursorInternal, getExecutionStepJournalInternal), workflow triggers (cancelExecutionInternal, updateScheduleInternal, deleteScheduleInternal, deleteWebhookInternal). Each REST handler passes `rc.org.organizationId`. Mismatches return null/empty (so REST surfaces 404) — never throw cross-tenantly to avoid leaking row existence. P0-5: rag_search IDOR + thread-binding Architectural change: chat uploads bind to their thread at upload time. - file_metadata schema: new optional `threadId` + composite index `by_organizationId_and_threadId`. - file_metadata.saveFileMetadata: accepts threadId; refuses cross-org threadId via threadMetadata lookup. - chat-input upload hook: passes the current chat threadId. - New helpers: `threads/get_thread_ancestor_chain.ts` (action-side walk of the delegation chain via existing `getParentThreadId`), `agent_tools/rag/helpers/verify_thread_scoped_access.ts` (query that same-org-checks each storageId, then if `meta.threadId` is set, requires it in the caller's accessible chain). - rag_search search-op: when explicit fileIds are supplied, verify via the new query (replaces unauthenticated short-circuit). - rag_search retrieve-op: replaces commit d7bc3da's stricter "agent allow-list" check, which over-strictly blocked legitimate chat-upload retrieval (chat uploads never appear in the agent's pre-configured `knowledgeFileIds`/`agentTeamId`/`includeOrgKnowledge` sets). Same-org + thread-scope is the correct invariant. Cascade integration: - threads/cascade_helpers.ts: deletes bound fileMetadata + storage blobs as part of thread hard-delete (Pass B / GDPR erasure path). RAG-side fan-out is deferred to commit 4 (P0-13). - threads/delete_chat_thread.ts (Pass A trash): cascades soft-delete to bound fileMetadata rows (lifecycleStatus='trashed', mirrors grace-extension defense). - threads/restore_chat_thread.ts: cascades restore to fileMetadata rows trashed within ±5s skew of the thread's trash time (avoids zombie-restoring files that were independently trashed earlier). Verified: `bun typecheck` clean; 871 tests across affected areas pass. Regression tests for the new gates land in commit 6 (test guards) per the bundle plan.
Closes #15, #16, #17, #18, #41 — secret sanitiser + audio-fetch headers. - `sanitize_secrets.ts` JSON-value class now honours backslash-escaped characters: `(?:[^"\\]|\\.)*` instead of `[^"]*`. Previously a value containing `\"` (an escaped quote inside the string) terminated the redaction at the first inner quote and left the rest of the JSON object exposed. Test added that pins the new behaviour. - `sanitize_secrets.ts` patterns extended with Stripe (`sk_/pk_/rk_` × `live/test`), OpenAI org/project identifiers (`org-…`, `proj_…`), Cookie / Set-Cookie header lines, and bare Better Auth session tokens. An idempotency check (sanitize ∘ sanitize = sanitize) and a 100k-char ReDoS guard round out the new coverage. - `http.ts /api/tts-audio` moves the per-IP rate limit ABOVE the Better Auth session lookup. An unauthenticated attacker hammering the route was previously forcing a DB session-query per request — mirrors the `/storage` route's order. - `http.ts /api/tts-audio` Cache-Control changes from `private, max-age=600` to `private, max-age=0, must-revalidate`. A removed member can no longer replay cached audio for up to 10 minutes past their removal; the revalidating round-trip re-hits the membership gate on every replay. - `http.ts /api/tts-audio` sets `Accept-Ranges: none` so iOS Safari `<audio preload="auto">` range probes don't trigger audible mid-chunk restarts.
Closes #15, #16, #17, #18, #41 — secret sanitiser + audio-fetch headers. - `sanitize_secrets.ts` JSON-value class now honours backslash-escaped characters: `(?:[^"\\]|\\.)*` instead of `[^"]*`. Previously a value containing `\"` (an escaped quote inside the string) terminated the redaction at the first inner quote and left the rest of the JSON object exposed. Test added that pins the new behaviour. - `sanitize_secrets.ts` patterns extended with Stripe (`sk_/pk_/rk_` × `live/test`), OpenAI org/project identifiers (`org-…`, `proj_…`), Cookie / Set-Cookie header lines, and bare Better Auth session tokens. An idempotency check (sanitize ∘ sanitize = sanitize) and a 100k-char ReDoS guard round out the new coverage. - `http.ts /api/tts-audio` moves the per-IP rate limit ABOVE the Better Auth session lookup. An unauthenticated attacker hammering the route was previously forcing a DB session-query per request — mirrors the `/storage` route's order. - `http.ts /api/tts-audio` Cache-Control changes from `private, max-age=600` to `private, max-age=0, must-revalidate`. A removed member can no longer replay cached audio for up to 10 minutes past their removal; the revalidating round-trip re-hits the membership gate on every replay. - `http.ts /api/tts-audio` sets `Accept-Ranges: none` so iOS Safari `<audio preload="auto">` range probes don't trigger audible mid-chunk restarts.
…conversational field
Add comprehensive documentation for chat agent features and workflow automation system. Remove deprecated 'conversational' configuration from LLM nodes across UI and backend.
Summary by CodeRabbit
Documentation
Changes
✏️ Tip: You can customize this high-level summary in your review settings.