From 78d682224a1b74874d4ae1bee0cbdff82cc47b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=95=AA=E8=8C=84=E6=91=94=E6=88=90=E7=95=AA=E8=8C=84?= =?UTF-8?q?=E9=85=B1?= <68098251+fqscfqj@users.noreply.github.com> Date: Fri, 19 Jun 2026 20:59:50 +0800 Subject: [PATCH] fix(grpc): forward word-level timestamps in AudioTranscription wrapper (#10402) The gRPC server wrapper in pkg/grpc/server.go reconstructs TranscriptSegment messages when relaying AudioTranscription results from backends. The Words field was not being copied, causing all word-level timestamps to be silently dropped regardless of backend support. This was introduced when PR #9621 added the TranscriptWord proto message and transcriptResultFromProto (server-side), but did not update the server-side gRPC relay to forward the new field. Fixes #9306 Signed-off-by: fqscfqj --- pkg/grpc/server.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/grpc/server.go b/pkg/grpc/server.go index 6ddb521ba..35afb502c 100644 --- a/pkg/grpc/server.go +++ b/pkg/grpc/server.go @@ -243,6 +243,14 @@ func (s *server) AudioTranscription(ctx context.Context, in *pb.TranscriptReques for _, t := range s.Tokens { tks = append(tks, int32(t)) } + words := make([]*pb.TranscriptWord, 0, len(s.Words)) + for _, w := range s.Words { + words = append(words, &pb.TranscriptWord{ + Start: int64(w.Start), + End: int64(w.End), + Text: w.Text, + }) + } tresult.Segments = append(tresult.Segments, &pb.TranscriptSegment{ Text: s.Text, @@ -251,6 +259,7 @@ func (s *server) AudioTranscription(ctx context.Context, in *pb.TranscriptReques End: int64(s.End), Tokens: tks, Speaker: s.Speaker, + Words: words, }) }