Skip to content

Comments

Bridge STT type gaps: surface C++ perf fields in Rust structs#4115

Merged
yujonglee merged 1 commit intomainfrom
devin/1771555741-bridge-stt-types
Feb 20, 2026
Merged

Bridge STT type gaps: surface C++ perf fields in Rust structs#4115
yujonglee merged 1 commit intomainfrom
devin/1771555741-bridge-stt-types

Conversation

@devin-ai-integration
Copy link
Contributor

Bridge STT type gaps: surface C++ perf fields in Rust structs

Summary

The cactus C++ FFI layer already emits performance/diagnostics fields in its JSON responses (time_to_first_token_ms, decode_tps, ram_usage_mb, token counts, etc.), but the Rust TranscriptionResult (batch) and StreamResult (streaming) structs were silently discarding them during deserialization.

This PR adds the missing fields to both structs so they're available to consumers. All new fields use #[serde(default)], so this is fully backwards-compatible — existing JSON without these fields will deserialize with zero-values.

No downstream consumers are changed yet; this just makes the data available.

Review & Testing Checklist for Human

  • Verify u64 vs f64 for token counts: TranscriptionResult uses u64 for prefill_tokens/decode_tokens/total_tokens (C++ writes them as integers), while StreamResult uses f64 (C++ build_stream_response round-trips them through json_number() which returns double). Confirm this matches what each C++ path actually emits in practice — a real transcription run would settle this.
  • Run a batch + streaming transcription on macOS and inspect the deserialized structs to confirm the new fields populate with real values (not just zero defaults). This couldn't be tested on the Devin machine since cactus-sys requires ARM.

Notes

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit faa2b27
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/6997cc3327b87d00084ea6f7

@devin-ai-integration
Copy link
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 that start with 'DevinAI' or '@devin'.
  • 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

@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit faa2b27
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6997cc35a02cf30008968d88

@yujonglee yujonglee merged commit e6f3794 into main Feb 20, 2026
14 checks passed
@yujonglee yujonglee deleted the devin/1771555741-bridge-stt-types branch February 20, 2026 03:00
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