feat: configurable response timeout with elapsed time feedback ⛵#143
feat: configurable response timeout with elapsed time feedback ⛵#143Klazomenai merged 8 commits intomainfrom
Conversation
- 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>
Refs #136 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
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.ResponseTimeoutand 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>
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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.
Summary
PipelineError.ResponseTimeout— dedicated error with message pointing to SettingsSecureStoragewith clamped getter/setter (5-300 range)Changes
PipelineState.ktResponseTimeouterror typeSecureStorage.ktresponseTimeoutSecproperty (default 60, clamped 5-300)MainViewModel.ktwithTimeout(),PipelineTimeoutExceptionMainActivity.ktResponseTimeouterror textSettingsActivity.ktactivity_settings.xmlstrings.xmlVoicePipelineTest.ktDEFAULT_RESPONSE_TIMEOUT_MSandResponseTimeoutTest plan
Refs #136