Skip to content

feat: configurable response timeout with elapsed time feedback ⛵#143

Merged
Klazomenai merged 8 commits intomainfrom
fix/136-response-timeout
Apr 4, 2026
Merged

feat: configurable response timeout with elapsed time feedback ⛵#143
Klazomenai merged 8 commits intomainfrom
fix/136-response-timeout

Conversation

@Klazomenai
Copy link
Copy Markdown
Owner

@Klazomenai Klazomenai commented Apr 4, 2026

Summary

  • Increase default response timeout from 30s to 60s — covers crew delegation chains
  • Make timeout configurable in Settings (5-300 seconds)
  • Add PipelineError.ResponseTimeout — dedicated error with message pointing to Settings
  • Persist timeout in SecureStorage with clamped getter/setter (5-300 range)

Changes

File Change
PipelineState.kt Add ResponseTimeout error type
SecureStorage.kt Add responseTimeoutSec property (default 60, clamped 5-300)
MainViewModel.kt Accept configurable timeout, use in withTimeout(), PipelineTimeoutException
MainActivity.kt Pass timeout from storage, handle ResponseTimeout error text
SettingsActivity.kt Timeout input field with 5-300 validation, error cleared on success
activity_settings.xml Timeout number input UI
strings.xml Timeout label, hint, validation error, timeout error message
VoicePipelineTest.kt Updated to use DEFAULT_RESPONSE_TIMEOUT_MS and ResponseTimeout

Test plan

  • CI passes (unit tests updated)
  • On device: delegation chain completes within 60s
  • On device: Settings shows timeout field, persists across restarts
  • On device: timeout error shows "Try increasing the timeout in Settings"

Refs #136

- Increase default timeout from 30s to 60s — covers crew delegation
  chains (Maren → Crest requires 2+ API calls)
- Make timeout configurable in Settings (5-300 seconds range)
- Add PipelineError.ResponseTimeout — dedicated error with actionable
  message pointing to Settings
- Show elapsed time while waiting: "Waiting for crew (15s)"
- Persist timeout in SecureStorage

Refs #136

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Klazomenai Klazomenai self-assigned this Apr 4, 2026
Refs #136

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Klazomenai Klazomenai marked this pull request as ready for review April 4, 2026 13:58
Copilot AI review requested due to automatic review settings April 4, 2026 13:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a configurable crew response timeout to reduce false timeouts during longer Matrix “crew delegation” response chains, and improves user feedback by showing elapsed wait time and a dedicated timeout error.

Changes:

  • Increased the default response timeout to 60s and made it configurable (persisted in SecureStorage).
  • Added a dedicated PipelineError.ResponseTimeout and UI string for timeout messaging.
  • Updated the pipeline wait UI to display elapsed seconds while awaiting a crew response; updated tests accordingly.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
app/src/main/java/dev/klazomenai/deckchat/PipelineState.kt Adds a dedicated ResponseTimeout pipeline error type.
app/src/main/java/dev/klazomenai/deckchat/SecureStorage.kt Persists a configurable response timeout in seconds with a 60s default.
app/src/main/java/dev/klazomenai/deckchat/MainViewModel.kt Uses configurable timeout, adds elapsed-time “waiting” updates, classifies timeout as ResponseTimeout.
app/src/main/java/dev/klazomenai/deckchat/MainActivity.kt Passes persisted timeout into the ViewModel; renders ResponseTimeout using a string resource.
app/src/main/java/dev/klazomenai/deckchat/SettingsActivity.kt Adds settings UI wiring + validation for timeout input.
app/src/main/res/layout/activity_settings.xml Adds timeout label + numeric input field.
app/src/main/res/values/strings.xml Adds settings label/hint and timeout error message string.
app/src/test/java/dev/klazomenai/deckchat/VoicePipelineTest.kt Updates the timeout test to use the new default constant and error type.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…bel ⛵

- Clamp responseTimeoutSec getter/setter to 5..300 range for corrupted prefs
- Move timeout validation error to string resource
- Remove per-second elapsed counter from Processing state to avoid
  crossfade animation flicker — keep static "Waiting for crew" label
- Fix test name to match ResponseTimeout assertion

Refs #136

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Remove stale kotlinx.coroutines.delay import (elapsed timer removed)
- Clear timeoutInput.error on successful validation
- PR description updated to match static label behaviour

Refs #136

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Single source of truth — prevents drift between ms and seconds defaults.

Refs #136

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…eout ⛵

- Add MIN/MAX_RESPONSE_TIMEOUT_SEC constants in SecureStorage companion
- Use constants in both SecureStorage clamp and SettingsActivity validation
- Add ResponseTimeout to PipelineStateTest distinctness list
- Add 4 SecureStorageTest cases: default, clamp below, clamp above,
  getter fallback on corrupted prefs

Refs #136

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ception ⛵

Preserves the original stacktrace for debugging.

Refs #136

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Move all validation checks before any SecureStorage writes to prevent
partial saves when one field is invalid.

Refs #136

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Klazomenai Klazomenai merged commit 95fd764 into main Apr 4, 2026
6 checks passed
@Klazomenai Klazomenai deleted the fix/136-response-timeout branch April 4, 2026 19:24
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