fix: subagent timeout disable button not working due to serde format mismatch#634
Merged
Merged
Conversation
…mismatch
The frontend was sending bare strings ('Disable', 'Restore') and
internally-tagged objects ({ Extend: { seconds } }) for the
set_subagent_timeout Tauri command, but the Rust backend DTO uses
#[serde(tag = "type", content = "payload")] (adjacently-tagged enum)
which expects { type: 'Disable', payload: null } format.
This mismatch caused serde deserialization to fail silently, so the
timeout was never actually disabled on the backend side.
Generated with BitFun
Co-Authored-By: BitFun
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When clicking the disable timeout button on a subagent timeout tag, the timeout was not actually disabled -- the subagent would still time out after the original deadline.
Root Cause
The frontend AgentAPI.setSubagentTimeout was sending payloads in a format that did not match the Rust backend DTO:
This caused the Tauri command to fail silently, so the timeout was never disabled on the backend.
Fix
Changed the frontend payload construction in AgentAPI.ts to use the correct adjacently-tagged format:
Testing