Skip to content

[LUM-753] Improve client-side dictation resilience#24042

Merged
noanflaherty merged 2 commits into
mainfrom
devin/1775585427-LUM-753-dictation-resilience
Apr 7, 2026
Merged

[LUM-753] Improve client-side dictation resilience#24042
noanflaherty merged 2 commits into
mainfrom
devin/1775585427-LUM-753-dictation-resilience

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Apr 7, 2026

Summary

Tunes the existing client-side dictation fallback to be less blocking when the daemon is unreachable (cloud-hosted assistants). The client already falls back to raw Apple Speech Recognition transcription on HTTP failure — this PR makes that happen faster and with better diagnostics.

Changes:

  • Reduce dictation HTTP timeout from 10s → 5s so users see their transcription sooner instead of staring at a "Processing…" spinner when the daemon can't be reached
  • Downgrade failure logs from errorwarning since these are expected failures with graceful recovery, not actionable errors
  • Add elapsed time to all failure log messages for latency debugging
  • Include transcription length in fallback log for diagnostics

No new fallback logic — the fallbackResponse / fallbackMode mechanism was already in place.

Review & Testing Checklist for Human

  • Confirm 5s timeout is acceptable. Cloud-hosted assistants route through the platform proxy which can add ~6s of actor-token bootstrap latency. With a 5s client timeout, cloud dictation will consistently fall back to raw transcription until the platform proxy is also fixed (PR #4007, currently draft). Verify this is the intended behavior.
  • Build and run dictation end-to-end on both a local and cloud-hosted assistant to confirm: (a) successful daemon responses still work within 5s, (b) fallback kicks in promptly on failure and text is inserted correctly.
  • Check monitoring/alerting: The log level change from errorwarning could affect any dashboards or alerts keyed on DictationClient error-level logs.

Notes

  • This is a companion to platform-side PR #4007 (currently draft) which adds server-side graceful degradation. The two are independent — either can land on its own.
  • Could not build locally (macOS/Xcode project on Linux VM). Relying on CI for build validation.

Link to Devin session: https://app.devin.ai/sessions/4d99242121f94fed84c1d80e873c569a
Requested by: @tkheyfets


Open with Devin

…evel logs, add timing

- Reduce dictation HTTP timeout from 10s to 5s so the client falls back
  to raw transcription faster when the daemon is unreachable
- Downgrade failure logs from error to warning since these are expected
  failures with graceful recovery (not actionable errors)
- Add elapsed time to all failure log messages for debugging latency
- Improve fallback log to include transcription length for diagnostics

Co-Authored-By: tkheyfets <timur@vellum.ai>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

4 similar comments
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

@tkheyfets
Copy link
Copy Markdown
Contributor

@codex review

Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment thread clients/shared/Network/DictationClient.swift
/// Timeout for the dictation HTTP request. Kept short so the client falls
/// back to raw transcription quickly when the daemon is unreachable rather
/// than leaving the user staring at a "Processing…" spinner.
static let requestTimeout: TimeInterval = 5
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🚩 Timeout reduction from 10s to 5s may cause more fallback usage under normal latency

The timeout was halved from 10s to 5s. The comment explains the rationale (faster fallback when the assistant is unreachable). However, if the dictation endpoint legitimately takes >5s under load or with longer transcriptions, users will silently get raw transcription instead of the cleaned-up assistant response. The new timing instrumentation will help diagnose this — the elapsed value in warning logs will show whether timeouts cluster near 5s (suggesting the timeout is too tight) vs near 0s (network unreachable). Worth monitoring after deployment.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c46f894c45

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

]

/// Timeout for the dictation HTTP request. Kept short so the client falls
/// back to raw transcription quickly when the daemon is unreachable rather
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Replace daemon terminology in client code comments

This comment reintroduces the term daemon in client code, which violates the explicit rule in clients/AGENTS.md (“Terminology: Avoid "Daemon" in Client Code”). The clients guidance requires using “assistant” in client-facing naming/comments to keep terminology consistent and avoid leaking backend implementation detail into client surfaces; please update this wording accordingly.

Useful? React with 👍 / 👎.

tkheyfets
tkheyfets previously approved these changes Apr 7, 2026
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@noanflaherty noanflaherty merged commit b80255c into main Apr 7, 2026
3 checks passed
@noanflaherty noanflaherty deleted the devin/1775585427-LUM-753-dictation-resilience branch April 7, 2026 18:21
noanflaherty added a commit that referenced this pull request Apr 7, 2026
* [LUM-753] Improve dictation resilience: reduce timeout, use warning-level logs, add timing

- Reduce dictation HTTP timeout from 10s to 5s so the client falls back
  to raw transcription faster when the daemon is unreachable
- Downgrade failure logs from error to warning since these are expected
  failures with graceful recovery (not actionable errors)
- Add elapsed time to all failure log messages for debugging latency
- Improve fallback log to include transcription length for diagnostics

Co-Authored-By: tkheyfets <timur@vellum.ai>

* Apply suggestions from code review

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: tkheyfets <timur@vellum.ai>
Co-authored-by: Noa Flaherty <noa@vellum.ai>
noanflaherty added a commit that referenced this pull request Apr 7, 2026
* fix: use borderElement for unchecked checkbox visibility (LUM-751) (#23992)

The ToS checkbox border used VColor.borderBase (#24292E dark) which is
identical to VCard's VColor.surfaceLift background (#24292E dark),
making the unchecked checkbox completely invisible in dark mode.

Switch to VColor.borderElement (#5A6672 dark / #CFCCC9 light) which
is the semantic token for interactive element borders and provides
clear contrast against the card background in both color schemes.

Closes LUM-751

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: ashlee@vellum.ai <ashlee@vellum.ai>

* fix: enable link click handling in VSelectableTextView (#23986)

Add NSTextViewDelegate to Coordinator with textView(_:clickedOnLink:at:)
to open clicked links in the default browser via NSWorkspace. The NSTextView
was already styling links (tint color, underline, pointer cursor) but had
no delegate to handle click events, making links visually styled but inert.

Closes LUM-748

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: ashlee@vellum.ai <ashlee@vellum.ai>

* fix: prevent onboarding from repeating name confirmation after tool calls (#23989)

The agentic loop calls the LLM again after tool results return. Combined
with "talk before you work" (SOUL.md) and "save immediately" (BOOTSTRAP.md),
the model would confirm the user's name, call file_edit, then re-confirm
the name in the continuation response.

Add explicit guidance in both BOOTSTRAP.md and SOUL.md to not repeat text
that was already shown before tool calls.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Update Vellum Cloud onboarding copy to emphasize always-on availability (#24022)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [LUM-753] Improve client-side dictation resilience (#24042)

* [LUM-753] Improve dictation resilience: reduce timeout, use warning-level logs, add timing

- Reduce dictation HTTP timeout from 10s to 5s so the client falls back
  to raw transcription faster when the daemon is unreachable
- Downgrade failure logs from error to warning since these are expected
  failures with graceful recovery (not actionable errors)
- Add elapsed time to all failure log messages for debugging latency
- Improve fallback log to include transcription length for diagnostics

Co-Authored-By: tkheyfets <timur@vellum.ai>

* Apply suggestions from code review

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: tkheyfets <timur@vellum.ai>
Co-authored-by: Noa Flaherty <noa@vellum.ai>

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: ashlee@vellum.ai <ashlee@vellum.ai>
Co-authored-by: asharma53 <64060709+asharma53@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: tkheyfets <timur@vellum.ai>
vellum-automation Bot added a commit that referenced this pull request Apr 7, 2026
* Release v0.6.2

* Cherry-pick fixes into release/v0.6.2 (#24074)

* fix: use borderElement for unchecked checkbox visibility (LUM-751) (#23992)

The ToS checkbox border used VColor.borderBase (#24292E dark) which is
identical to VCard's VColor.surfaceLift background (#24292E dark),
making the unchecked checkbox completely invisible in dark mode.

Switch to VColor.borderElement (#5A6672 dark / #CFCCC9 light) which
is the semantic token for interactive element borders and provides
clear contrast against the card background in both color schemes.

Closes LUM-751

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: ashlee@vellum.ai <ashlee@vellum.ai>

* fix: enable link click handling in VSelectableTextView (#23986)

Add NSTextViewDelegate to Coordinator with textView(_:clickedOnLink:at:)
to open clicked links in the default browser via NSWorkspace. The NSTextView
was already styling links (tint color, underline, pointer cursor) but had
no delegate to handle click events, making links visually styled but inert.

Closes LUM-748

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: ashlee@vellum.ai <ashlee@vellum.ai>

* fix: prevent onboarding from repeating name confirmation after tool calls (#23989)

The agentic loop calls the LLM again after tool results return. Combined
with "talk before you work" (SOUL.md) and "save immediately" (BOOTSTRAP.md),
the model would confirm the user's name, call file_edit, then re-confirm
the name in the continuation response.

Add explicit guidance in both BOOTSTRAP.md and SOUL.md to not repeat text
that was already shown before tool calls.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Update Vellum Cloud onboarding copy to emphasize always-on availability (#24022)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [LUM-753] Improve client-side dictation resilience (#24042)

* [LUM-753] Improve dictation resilience: reduce timeout, use warning-level logs, add timing

- Reduce dictation HTTP timeout from 10s to 5s so the client falls back
  to raw transcription faster when the daemon is unreachable
- Downgrade failure logs from error to warning since these are expected
  failures with graceful recovery (not actionable errors)
- Add elapsed time to all failure log messages for debugging latency
- Improve fallback log to include transcription length for diagnostics

Co-Authored-By: tkheyfets <timur@vellum.ai>

* Apply suggestions from code review

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: tkheyfets <timur@vellum.ai>
Co-authored-by: Noa Flaherty <noa@vellum.ai>

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: ashlee@vellum.ai <ashlee@vellum.ai>
Co-authored-by: asharma53 <64060709+asharma53@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: tkheyfets <timur@vellum.ai>

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Noa Flaherty <noa@vellum.ai>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: ashlee@vellum.ai <ashlee@vellum.ai>
Co-authored-by: asharma53 <64060709+asharma53@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: tkheyfets <timur@vellum.ai>
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.

2 participants