Skip to content

feat(assistant-api): add greetingInterruptible to deployments#149

Merged
iamprashant merged 3 commits into
mainfrom
feature/greeting-interruptible-deployments
Jun 17, 2026
Merged

feat(assistant-api): add greetingInterruptible to deployments#149
iamprashant merged 3 commits into
mainfrom
feature/greeting-interruptible-deployments

Conversation

@iamprashant

@iamprashant iamprashant commented Jun 16, 2026

Copy link
Copy Markdown
Member

Description

Adds greetingInterruptible support across backend deployment creation flows.

Changes

  • Added greetingInterruptible to OpenAPI deployment create/request response models.
  • Added greetingInterruptible to deployment proto definitions and regenerated artifacts.
  • Propagated the field through REST and gRPC create handlers.
  • Updated deployment service interfaces and implementations.
  • Included greetingInterruptible in deployment REST responses.
  • Added focused REST tests for create deployment requests/responses.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Configuration change
  • Refactoring (no functional changes)
  • Test update
  • Security fix

Related Issues

Fixes #

Checklist

General

  • I have read the CONTRIBUTING guidelines
  • My code follows the project's coding standards
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested my changes on multiple platforms (if applicable)

Documentation

  • I have updated the documentation accordingly
  • I have updated the API documentation (if applicable)

Security

  • My changes do not introduce any security vulnerabilities
  • I have not committed any sensitive data (API keys, passwords, etc.)

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a Greeting Interruptible boolean field to assistant deployment creation for API, Debugger, Phone, WhatsApp, and WebPlugin.
    • Assistant deployment create and retrieval responses now consistently return greetingInterruptible for the affected deployment types.
  • UI Updates

    • Updated the deployment “Experience” configuration to include an always-visible Greeting Interruptible toggle (defaulting to enabled when not set).
  • Tests / API Schema

    • Updated OpenAPI, client models, and REST/UI tests to support the new field.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a new greetingInterruptible boolean field to all five assistant deployment types across the full stack (gRPC/REST handlers, service interface/implementation, OpenAPI, protobuf, UI) and introduces a comprehensive watchdog-based timeout management system to replace prior timer-based idle and TTS deadline tracking. The watchdog system gates audio input during non-interruptible greetings, handles context-aware packet generation, and emits observability records. TTS websocket error handling is refactored, initialization flow tests are expanded to validate greeting audio gating behavior, and the @rapidaai/react dependency is bumped to 1.1.80.

Changes

greetingInterruptible field propagation across deployment stack

Layer / File(s) Summary
Service interface and implementation
api/assistant-api/internal/services/deployment.assistant.service.go, api/assistant-api/internal/services/assistant/assistant.deployment.impl.service.go
AssistantDeploymentService interface adds greetingInterruptible *bool to all five Create method signatures; the implementation reads the parameter and sets GreetingInterruptible on each deployment struct initializer.
gRPC create handlers
api/assistant-api/api/assistant-deployment/create_assistant_api_deployment.go, create_assistant_debugger_deployment.go, create_assistant_phone_deployment.go, create_assistant_webplugin_deployment.go, create_assistant_whatsapp_deployment.go
Each gRPC create handler reads GreetingInterruptible from the incoming proto request and forwards it to the service call.
REST create and get handlers with response mapping
api/assistant-api/api/assistant-deployment/create_assistant_*_rest.go, get_assistant_*_rest.go, get_all_assistant_*_rest.go
All five REST create handlers pass request.GreetingInterruptible into the service call and include it in the created-deployment response struct. All five get-single and get-all handlers populate GreetingInterruptible in their response payloads from the deployment model.
OpenAPI specification and generated client models
openapi/artifacts/assistant-api.yaml, openapi/assistant.gen.go
OpenAPI YAML adds greetingInterruptible: boolean property to all five request and response deployment schemas. Generated Go client models add the GreetingInterruptible *bool field to all five response and request struct types.
Backend REST handler tests
api/assistant-api/api/assistant-deployment/create_assistant_debugger_deployment_rest_test.go, create_assistant_phone_deployment_rest_test.go, create_other_deployments_rest_test.go
Service stubs gain a greetingInterruptible field and parameter across all five Create methods, storing and propagating the value into the AssistantDeploymentBehavior. Happy-path tests extend request JSON with greetingInterruptible: false and assert propagation through the stub to the response payload.
Python protobuf generated files
api/document-api/app/bridges/artifacts/protos/assistant_deployment_pb2.py, assistant_deployment_pb2.pyi
Regenerated descriptor blob and updated offset constants; type stubs for all five Assistant*Deployment messages add GREETINGINTERRUPTIBLE_FIELD_NUMBER constant, greetingInterruptible: bool attribute, __slots__ entry, and __init__ parameter.
ExperienceConfig interface and ConfigureExperience component refactor
ui/src/app/pages/assistant/actions/create-deployment/commons/configure-experience.tsx, ui/package.json
ExperienceConfig adds greetingInterruptible?: boolean. ConfigureExperience is refactored from greeting-only with collapsible advanced settings into always-visible controls: greeting text, greeting interrupt Toggle, ComboBox inputs for error/idle messages with predefined suggestions, and Slider controls for timeout/backoff/max duration. Dependency @rapidaai/react bumped to 1.1.80.
Shared deployment section-edit hook
ui/src/app/pages/assistant/actions/create-deployment/hooks/use-deployment-section-edit.ts
Hook extends DEFAULT_EXPERIENCE with greetingInterruptible: true, populates it from fetched deployments with a true fallback, and sets greetinginterruptible on the common deployment payload.
All five deployment pages (create/edit/index)
ui/src/app/pages/assistant/actions/create-deployment/api/*, debugger/*, phone/*, web-plugin/*
API, Debugger, Phone, and WebPlugin create/edit/index pages initialize greetingInterruptible: true in default experience state, populate it from fetched deployments with a true fallback, and pass it to the deployment request via setGreetinginterruptible.
UI test mock updates and button sizing
ui/src/app/pages/assistant/actions/create-deployment/api/__tests__/voice-input-intent.test.tsx, debugger/__tests__/voice-input-intent.test.tsx, phone/__tests__/deployment-create-edit.test.tsx, web-plugin/__tests__/voice-input-intent.test.tsx, ui/src/app/components/carbon/button/index.tsx, ui/src/app/pages/preview-agent/voice-agent/voice-agent.tsx
Jest mocks for all four deployment classes add setGreetinginterruptible setters; mocked getData fixtures add hasGreetinginterruptible() and getGreetinginterruptible() methods returning true. IconButtonSize removes 'xs' option; InfoRow button size changed from xs to sm.

Watchdog-based idle timeout and TTS completion management

Layer / File(s) Summary
Idle timeout and TTS completion watchdog implementations
api/assistant-api/internal/watchdog/idle_timeout.go, idle_timeout_test.go, tts_completion.go, tts_completion_test.go, options.go
Introduces IdleTimeoutWatchdog supporting Start/Extend/Stop/Cancel/Count/IncrementCount lifecycle; TTSCompletionWatchdog supporting StartFromText/Start/Extend/Complete/Cancel with speech duration estimation; shared option helpers WithOnPacket/WithPacketContext/WithRecordScope for both watchdogs; comprehensive test suites validating expiration, extension, context replacement, and observability emission.
IdleTimeoutExpiredPacket type and router integration
api/assistant-api/internal/type/packet.go, api/assistant-api/internal/adapters/router/dispatch.go, dispatch_test.go, router.go, router_test.go
Adds PacketNameIdleTimeoutExpired constant and IdleTimeoutExpiredPacket struct with ContextID/Count fields; DispatchHandler interface adds HandleIdleTimeoutExpired method; DispatchPacket type switch routes packet to handler; ClassifyName routes packet to RouteEgress; tests updated to expect the new packet routing.
Requestor initialization and watchdog binding
api/assistant-api/internal/adapters/internal/requestor.go
genericRequestor replaces idle-timer state with idleTimeoutWatchdog and ttsCompletionWatchdog instances; NewGenericRequestor initializes both watchdogs with gr.OnPacket callback, binds them to sessionCtx, and sets 300ms grace period for TTS watchdog.
Dispatch handler refactored for watchdog-based timeout management
api/assistant-api/internal/adapters/internal/dispatch_handler.go
HandleStartIdleTimeout now starts idleTimeoutWatchdog; HandleStopIdleTimeout stops it; HandleIdleTimeoutExpired delegates to onIdleTimeout. TextToSpeechText/TextToSpeechDone handlers start ttsCompletionWatchdog from text. TextToSpeechAudio extends both idle and TTS watchdogs by audio duration. TextToSpeechEnd completes ttsCompletionWatchdog. HandleInitializeBehavior returns early after logging failure. HandleFinalizeBehavior cancels both watchdogs. Dispatch policy after TextToSpeechEnd routes to PacketNameUserTextReceived.
Behavior adapter updated for watchdog-based idle timeout and greeting gating
api/assistant-api/internal/adapters/internal/behavior.go
initializeGreeting adds DispatchPolicyPacket to suppress PacketNameUserTextReceived when greeting is non-interruptible in audio mode. onIdleTimeout reads idleTimeoutCount from idleTimeoutWatchdog.Count() and increments via watchdog. Removed extendIdleTimeoutTimer helper that previously extended idle timeout for buffered TTS.
Behavior tests updated for watchdog-based counting and greeting audio gating
api/assistant-api/internal/adapters/internal/behavior_test.go
newBehaviorDisconnectTestRequestor initializes idle-timeout and TTS-completion watchdogs. Tests for idle timeout backoff increment/observe watchdog counts. Greeting tests assert additional "user text received" dispatch policy for non-interruptible audio. New test TestHandleTextToSpeechEnd_DoesNotRestorePoliciesForStaleContext validates stale context handling. Removed TestBehavior_ExtendIdleTimeoutTimer.
Initialization flow and greeting behavior tests
api/assistant-api/internal/adapters/internal/dispatch_init_flow_test.go, dispatch_init_packets_test.go
New tests validate InitializationFailedPacket non-recoverable error handling, session context cancellation, TextToSpeechPacket config errors, greeting audio blocking based on GreetingInterruptible (nil/true/false), initialization packet routing to bootstrap channel, text/audio mode packet sequencing, and behavior unavailability logging.
TTS websocket transformer refactored for early readLoop start and context-aware error handling
api/assistant-api/internal/transformer/custom/tts_websocket_v1/tts.go
getOrOpenConnection now starts readLoop goroutine immediately after setting connection state, before emitting observability. readLoop performs non-blocking context-cancellation check at iteration start. After websocket read errors, loop emits TextToSpeechErrorPacket and exits instead of continuing frame parsing.
Stream test refactored for initialization configuration
api/assistant-api/internal/adapters/internal/stream_test.go
Removed TestOnNotifyAssistantConfiguration_ForwardsAmbientOptions. Added TestOnNotifyAssistantConfiguration_ForwardsInitializationConfig validating that OnNotifyAssistantConfiguration forwards the conversationInitialization pointer to the stream.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • rapidaai/voice-ai#140: Both PRs modify the same greeting-interruptibility behavior path—api/assistant-api/internal/adapters/internal/behavior.go and its related tests—so the retrieved "packet-controlled input gate" work is directly intertwined with main PR's GreetingInterruptible gating/persistence changes.
  • rapidaai/voice-ai#145: The main PR's updates to assistant deployment REST handlers (e.g., CreateAssistantApiDeploymentRest, CreateAssistantPhoneDeploymentRest, etc.) to pass and return GreetingInterruptible build directly on the assistant deployment REST API surface introduced in the retrieved PR.

Poem

🐇 A greeting that bounces, a toggle to flip,
The watchdog now guards every interruptible trip!
From gRPC to React, through idle timeouts and TTS,
GreetingInterruptible gates audio with finesse.
Five deployments patched with audio-blocking grace,
The warren rejoices—watchdogs run the race! ⏱️✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/greeting-interruptible-deployments

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@ui/src/app/pages/assistant/actions/create-deployment/api/__tests__/voice-input-intent.test.tsx`:
- Line 68: The test file lacks real assertions to verify that
greetingInterruptible is properly propagated in the deployment request, despite
having mock surface expansions like setGreetinginterruptible at line 68 and
similar mocks at lines 266-267. Add test cases with actual assertions that
verify the outgoing deployment request carries the greetingInterruptible value,
including both a happy-path case where it is true and an edge-case regression
test where it is false. This ensures the contract is properly tested and cannot
regress unnoticed.

In
`@ui/src/app/pages/assistant/actions/create-deployment/debugger/__tests__/voice-input-intent.test.tsx`:
- Line 64: The `greetingInterruptible` field is added to the mock implementation
in the test file but lacks corresponding test assertions to verify its behavior.
Add test cases in the voice-input-intent.test.tsx file that verify the
`greetingInterruptible` field is correctly preserved in the built deployment
request, including at least a happy-path assertion (testing true and false
values are properly handled) and a regression/edge-case assertion (such as
verifying overrides or boundary conditions). This ensures the new field behavior
is properly validated according to the UI testing guidelines requiring both
happy-path and edge-case coverage for changes to ui/src files.

In
`@ui/src/app/pages/assistant/actions/create-deployment/phone/__tests__/deployment-create-edit.test.tsx`:
- Line 69: The test file lacks assertions for the newly introduced
greetingInterruptible field. Add test assertions to verify that the create and
edit deployment flows properly send the expected greetingInterruptible value.
Specifically, add a happy-path test assertion that validates
greetingInterruptible is correctly transmitted with the expected value, and add
an edge or regression test assertion that covers an alternative scenario (such
as toggling the value or testing boundary conditions). Reference the
setGreetinginterruptible mock method to verify the field is being passed through
the deployment creation and editing flows as intended.

In
`@ui/src/app/pages/assistant/actions/create-deployment/web-plugin/__tests__/voice-input-intent.test.tsx`:
- Line 62: The test file contains mock methods like setGreetinginterruptible for
API compatibility but lacks explicit assertions verifying that the
greetingInterruptible parameter is actually preserved in the deployment creation
request. Add test assertions to verify this behavior at multiple sites where the
mock is used. Include both a happy-path assertion that confirms
greetingInterruptible is correctly passed through in the outgoing request, and a
regression or edge-case assertion (such as testing with an edge value like false
or true) to ensure the parameter is handled correctly across different
scenarios.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b5a5d8bf-1dbf-49a0-8cef-ad942f2e2988

📥 Commits

Reviewing files that changed from the base of the PR and between f0ffdda and fc34a04.

⛔ Files ignored due to path filters (1)
  • ui/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (42)
  • api/assistant-api/api/assistant-deployment/create_assistant_api_deployment.go
  • api/assistant-api/api/assistant-deployment/create_assistant_api_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/create_assistant_debugger_deployment.go
  • api/assistant-api/api/assistant-deployment/create_assistant_debugger_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/create_assistant_debugger_deployment_rest_test.go
  • api/assistant-api/api/assistant-deployment/create_assistant_phone_deployment.go
  • api/assistant-api/api/assistant-deployment/create_assistant_phone_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/create_assistant_phone_deployment_rest_test.go
  • api/assistant-api/api/assistant-deployment/create_assistant_webplugin_deployment.go
  • api/assistant-api/api/assistant-deployment/create_assistant_webplugin_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/create_assistant_whatsapp_deployment.go
  • api/assistant-api/api/assistant-deployment/create_assistant_whatsapp_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/create_other_deployments_rest_test.go
  • api/assistant-api/api/assistant-deployment/get_all_assistant_api_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/get_all_assistant_debugger_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/get_all_assistant_phone_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/get_all_assistant_webplugin_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/get_all_assistant_whatsapp_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/get_assistant_api_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/get_assistant_debugger_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/get_assistant_phone_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/get_assistant_webplugin_deployment_rest.go
  • api/assistant-api/api/assistant-deployment/get_assistant_whatsapp_deployment_rest.go
  • api/assistant-api/internal/services/assistant/assistant.deployment.impl.service.go
  • api/assistant-api/internal/services/deployment.assistant.service.go
  • api/document-api/app/bridges/artifacts/protos/assistant_deployment_pb2.py
  • api/document-api/app/bridges/artifacts/protos/assistant_deployment_pb2.pyi
  • ui/package.json
  • ui/src/app/pages/assistant/actions/create-deployment/api/__tests__/voice-input-intent.test.tsx
  • ui/src/app/pages/assistant/actions/create-deployment/api/edit.tsx
  • ui/src/app/pages/assistant/actions/create-deployment/api/index.tsx
  • ui/src/app/pages/assistant/actions/create-deployment/commons/configure-experience.tsx
  • ui/src/app/pages/assistant/actions/create-deployment/debugger/__tests__/voice-input-intent.test.tsx
  • ui/src/app/pages/assistant/actions/create-deployment/debugger/edit.tsx
  • ui/src/app/pages/assistant/actions/create-deployment/debugger/index.tsx
  • ui/src/app/pages/assistant/actions/create-deployment/hooks/use-deployment-section-edit.ts
  • ui/src/app/pages/assistant/actions/create-deployment/phone/__tests__/deployment-create-edit.test.tsx
  • ui/src/app/pages/assistant/actions/create-deployment/phone/edit.tsx
  • ui/src/app/pages/assistant/actions/create-deployment/phone/index.tsx
  • ui/src/app/pages/assistant/actions/create-deployment/web-plugin/__tests__/voice-input-intent.test.tsx
  • ui/src/app/pages/assistant/actions/create-deployment/web-plugin/edit.tsx
  • ui/src/app/pages/assistant/actions/create-deployment/web-plugin/index.tsx

private outputAudio?: DeploymentAudioProvider;
setAssistantid(_: string) {}
setGreeting(_: string) {}
setGreetinginterruptible(_: boolean) {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add a real assertion for greetingInterruptible propagation.

Line 68 and Lines 266-267 only expand the mock surface; the suite still never verifies the outgoing deployment request carries greetingInterruptible (including an edge case where it is false). This allows this contract to regress unnoticed.

As per coding guidelines, ui/src/**/*.{ts,tsx} changes must include UI unit tests, and ui/src/**/@(__tests__|*.test.tsx|*.spec.tsx) must include at least a happy-path and a regression/edge assertion tied to the change.

Also applies to: 266-267

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@ui/src/app/pages/assistant/actions/create-deployment/api/__tests__/voice-input-intent.test.tsx`
at line 68, The test file lacks real assertions to verify that
greetingInterruptible is properly propagated in the deployment request, despite
having mock surface expansions like setGreetinginterruptible at line 68 and
similar mocks at lines 266-267. Add test cases with actual assertions that
verify the outgoing deployment request carries the greetingInterruptible value,
including both a happy-path case where it is true and an edge-case regression
test where it is false. This ensures the contract is properly tested and cannot
regress unnoticed.

Source: Coding guidelines

private outputAudio?: DeploymentAudioProvider;
setAssistantid(_: string) {}
setGreeting(_: string) {}
setGreetinginterruptible(_: boolean) {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

greetingInterruptible is mocked but not tested in request assertions.

Line 64 and Lines 243-244 add the field to mocks/fixtures, but no test verifies the built deployment request preserves that value (or a false-path override). Please add assertions tied to this new field behavior.

As per coding guidelines, ui/src/**/*.{ts,tsx} changes must include UI unit tests, and ui/src/**/@(__tests__|*.test.tsx|*.spec.tsx) must include at least a happy-path and a regression/edge assertion tied to the change.

Also applies to: 243-244

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@ui/src/app/pages/assistant/actions/create-deployment/debugger/__tests__/voice-input-intent.test.tsx`
at line 64, The `greetingInterruptible` field is added to the mock
implementation in the test file but lacks corresponding test assertions to
verify its behavior. Add test cases in the voice-input-intent.test.tsx file that
verify the `greetingInterruptible` field is correctly preserved in the built
deployment request, including at least a happy-path assertion (testing true and
false values are properly handled) and a regression/edge-case assertion (such as
verifying overrides or boundary conditions). This ensures the new field behavior
is properly validated according to the UI testing guidelines requiring both
happy-path and edge-case coverage for changes to ui/src files.

Source: Coding guidelines

private phoneOptions: Metadata[] = [];
setAssistantid(_: string) {}
setGreeting(_: string) {}
setGreetinginterruptible(_: boolean) {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Phone deployment tests need a greetingInterruptible assertion.

Line 69 and Lines 261-262 introduce the new field in mocks, but the tests don’t assert that create/edit flows actually send the expected greetingInterruptible value. Add a happy-path assertion and one edge/regression assertion for this field.

As per coding guidelines, ui/src/**/*.{ts,tsx} changes must include UI unit tests, and ui/src/**/@(__tests__|*.test.tsx|*.spec.tsx) must include at least a happy-path and a regression/edge assertion tied to the change.

Also applies to: 261-262

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@ui/src/app/pages/assistant/actions/create-deployment/phone/__tests__/deployment-create-edit.test.tsx`
at line 69, The test file lacks assertions for the newly introduced
greetingInterruptible field. Add test assertions to verify that the create and
edit deployment flows properly send the expected greetingInterruptible value.
Specifically, add a happy-path test assertion that validates
greetingInterruptible is correctly transmitted with the expected value, and add
an edge or regression test assertion that covers an alternative scenario (such
as toggling the value or testing boundary conditions). Reference the
setGreetinginterruptible mock method to verify the field is being passed through
the deployment creation and editing flows as intended.

Source: Coding guidelines

private outputAudio?: DeploymentAudioProvider;
setAssistantid(_: string) {}
setGreeting(_: string) {}
setGreetinginterruptible(_: boolean) {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Web-plugin suite should assert greetingInterruptible behavior, not only mock it.

Line 62 and Lines 257-258 add API-surface compatibility, but no test checks that deployment creation preserves greetingInterruptible in the outgoing request (including an edge value). Please add explicit assertions.

As per coding guidelines, ui/src/**/*.{ts,tsx} changes must include UI unit tests, and ui/src/**/@(__tests__|*.test.tsx|*.spec.tsx) must include at least a happy-path and a regression/edge assertion tied to the change.

Also applies to: 257-258

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@ui/src/app/pages/assistant/actions/create-deployment/web-plugin/__tests__/voice-input-intent.test.tsx`
at line 62, The test file contains mock methods like setGreetinginterruptible
for API compatibility but lacks explicit assertions verifying that the
greetingInterruptible parameter is actually preserved in the deployment creation
request. Add test assertions to verify this behavior at multiple sites where the
mock is used. Include both a happy-path assertion that confirms
greetingInterruptible is correctly passed through in the outgoing request, and a
regression or edge-case assertion (such as testing with an edge value like false
or true) to ensure the parameter is handled correctly across different
scenarios.

Source: Coding guidelines

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
openapi/artifacts/assistant-api.yaml (1)

814-815: 💤 Low value

Consider adding a description for the greetingInterruptible field.

Adding a brief description would improve API documentation and help consumers understand the field's purpose. This could be applied consistently across all deployment schemas.

Example:

greetingInterruptible:
  type: boolean
  description: Whether the greeting message can be interrupted by user input
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@openapi/artifacts/assistant-api.yaml` around lines 814 - 815, The
greetingInterruptible field in the deployment schema is missing a description
property, which reduces API documentation clarity. Add a description field to
the greetingInterruptible boolean property to explain its purpose, such as
"Whether the greeting message can be interrupted by user input" or similar
descriptive text that clarifies the field's behavior for API consumers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@openapi/artifacts/assistant-api.yaml`:
- Around line 814-815: The greetingInterruptible field in the deployment schema
is missing a description property, which reduces API documentation clarity. Add
a description field to the greetingInterruptible boolean property to explain its
purpose, such as "Whether the greeting message can be interrupted by user input"
or similar descriptive text that clarifies the field's behavior for API
consumers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a942ed77-bdca-4276-b3dc-f16c0cb53ad1

📥 Commits

Reviewing files that changed from the base of the PR and between fc34a04 and edf371d.

⛔ Files ignored due to path filters (1)
  • protos/assistant-deployment.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (3)
  • openapi/artifacts/assistant-api.yaml
  • openapi/assistant.gen.go
  • protos/artifacts
✅ Files skipped from review due to trivial changes (2)
  • protos/artifacts
  • openapi/assistant.gen.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
api/assistant-api/internal/watchdog/idle_timeout_test.go (1)

113-120: ⚡ Quick win

Harden timing assertions to reduce flaky test behavior.

Lines 113-120 and 156-160 use narrow sleep/timeout windows. Under CI jitter these can intermittently fail. Prefer polling-based assertions (require.Eventually / assert.Never) with bounded intervals instead of fixed time.Sleep.

Also applies to: 156-160

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/assistant-api/internal/watchdog/idle_timeout_test.go` around lines 113 -
120, Replace the fixed timing assertions in the idle timeout watchdog test with
polling-based assertions to reduce flakiness. Instead of using fixed time.Sleep
and time.After with narrow windows, use require.Eventually or assert.Never with
reasonable polling intervals and timeouts. Specifically, in the select statement
where you check whether a packet was pushed (around lines 117-120), replace the
time.After approach with a polling assertion that repeatedly checks the
condition rather than relying on a single timeout window, and similarly apply
this pattern to any other locations mentioned (lines 156-160) that use fixed
sleep windows.
api/assistant-api/internal/watchdog/tts_completion_test.go (1)

156-164: ⚡ Quick win

Use polling-based assertions for deadline-sensitive flows.

These ranges rely on strict wall-clock timing and can be flaky in slower CI workers. Replacing fixed sleeps/timeouts with require.Eventually/assert.Never will make expiration checks more stable.

Also applies to: 191-205, 239-243

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/assistant-api/internal/watchdog/tts_completion_test.go` around lines 156
- 164, The test uses fixed duration sleeps and timeouts (time.Sleep and
time.After with hardcoded millisecond values) which makes it flaky on slower CI
workers. Replace the timing-based assertions in the ttsCompletionWatchdog test
with polling-based assertions using require.Eventually or assert.Never.
Specifically, convert the select block that checks if a packet was pushed before
the extended deadline and the fixed sleep patterns into require.Eventually or
assert.Never calls that poll for the condition rather than relying on exact
wall-clock timing.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@api/assistant-api/internal/watchdog/idle_timeout_test.go`:
- Around line 113-120: Replace the fixed timing assertions in the idle timeout
watchdog test with polling-based assertions to reduce flakiness. Instead of
using fixed time.Sleep and time.After with narrow windows, use
require.Eventually or assert.Never with reasonable polling intervals and
timeouts. Specifically, in the select statement where you check whether a packet
was pushed (around lines 117-120), replace the time.After approach with a
polling assertion that repeatedly checks the condition rather than relying on a
single timeout window, and similarly apply this pattern to any other locations
mentioned (lines 156-160) that use fixed sleep windows.

In `@api/assistant-api/internal/watchdog/tts_completion_test.go`:
- Around line 156-164: The test uses fixed duration sleeps and timeouts
(time.Sleep and time.After with hardcoded millisecond values) which makes it
flaky on slower CI workers. Replace the timing-based assertions in the
ttsCompletionWatchdog test with polling-based assertions using
require.Eventually or assert.Never. Specifically, convert the select block that
checks if a packet was pushed before the extended deadline and the fixed sleep
patterns into require.Eventually or assert.Never calls that poll for the
condition rather than relying on exact wall-clock timing.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b60de06d-77d3-44fd-ba57-f8da4b20b0b7

📥 Commits

Reviewing files that changed from the base of the PR and between edf371d and 3682ddf.

📒 Files selected for processing (20)
  • api/assistant-api/internal/adapters/internal/behavior.go
  • api/assistant-api/internal/adapters/internal/behavior_test.go
  • api/assistant-api/internal/adapters/internal/dispatch_handler.go
  • api/assistant-api/internal/adapters/internal/dispatch_init_flow_test.go
  • api/assistant-api/internal/adapters/internal/dispatch_init_packets_test.go
  • api/assistant-api/internal/adapters/internal/requestor.go
  • api/assistant-api/internal/adapters/internal/stream_test.go
  • api/assistant-api/internal/adapters/router/dispatch.go
  • api/assistant-api/internal/adapters/router/dispatch_test.go
  • api/assistant-api/internal/adapters/router/router.go
  • api/assistant-api/internal/adapters/router/router_test.go
  • api/assistant-api/internal/transformer/custom/tts_websocket_v1/tts.go
  • api/assistant-api/internal/type/packet.go
  • api/assistant-api/internal/watchdog/idle_timeout.go
  • api/assistant-api/internal/watchdog/idle_timeout_test.go
  • api/assistant-api/internal/watchdog/options.go
  • api/assistant-api/internal/watchdog/tts_completion.go
  • api/assistant-api/internal/watchdog/tts_completion_test.go
  • ui/src/app/components/carbon/button/index.tsx
  • ui/src/app/pages/preview-agent/voice-agent/voice-agent.tsx
💤 Files with no reviewable changes (1)
  • api/assistant-api/internal/transformer/custom/tts_websocket_v1/tts.go
✅ Files skipped from review due to trivial changes (3)
  • ui/src/app/pages/preview-agent/voice-agent/voice-agent.tsx
  • api/assistant-api/internal/adapters/router/dispatch_test.go
  • api/assistant-api/internal/watchdog/options.go

@iamprashant iamprashant merged commit 3959706 into main Jun 17, 2026
30 of 31 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