Skip to content

fix: subagent timeout disable button not working due to serde format mismatch#634

Merged
bobleer merged 1 commit into
mainfrom
fix/subagent-timeout-disable-button
May 10, 2026
Merged

fix: subagent timeout disable button not working due to serde format mismatch#634
bobleer merged 1 commit into
mainfrom
fix/subagent-timeout-disable-button

Conversation

@bobleer
Copy link
Copy Markdown
Collaborator

@bobleer bobleer commented May 10, 2026

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:

  • Backend SetSubagentTimeoutActionDTO uses #[serde(tag = "type", content = "payload")] (adjacently-tagged enum), expecting: { "type": "Disable", "payload": null }
  • Frontend was sending bare strings "Disable" / "Restore" and internally-tagged objects { "Extend": { "seconds": 120 } }, which serde could not deserialize

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:

  • Before: 'Disable' / 'Restore' / { Extend: { seconds } }
  • After: { type: 'Disable', payload: null } / { type: 'Restore', payload: null } / { type: 'Extend', payload: { seconds } }

Testing

  • pnpm run type-check:web passed
  • Business logic review verified the payload format matches the Rust serde definition correctly

…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
@bobleer bobleer merged commit 792385d into main May 10, 2026
4 checks passed
@GCWing GCWing deleted the fix/subagent-timeout-disable-button branch May 11, 2026 00:51
@bobleer bobleer restored the fix/subagent-timeout-disable-button branch May 11, 2026 02:01
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