Repository navigation
fix(logging): carry the work's duration on AI log lines - #1544
Merged
Merged
Conversation
ai.chain.served, ai.chain.failed and ai.job.failed read duration_ms=0 whatever the work took, a ten-minute document read included: each is a signal line built and finished in one step, so the only thing timed was the writing of the line. emitSignal and emitOutcome take an optional durationMs. The chain wrapper times each provider call from request to answer or failure, and trackAiJob times the job and hands it to the failure line. A signal that cannot know a duration now leaves the field out instead of claiming zero. The AI providers guide explains the two codes: the chain line's code is the operating system's error code behind the failure kind, empty for HealthLog's own response timeout, while the job line carries the job's closed code such as provider_timeout. Refs #1404
# Conflicts: # CHANGELOG.md
This was referenced Nov 26, 2026
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.
ai.chain.served,ai.chain.failedandai.job.failedcarriedduration_ms=0whatever the work took, a ten-minute document read included. Each is a signal line built and finished in one step, so only the writing of the line was timed.emitSignal/emitOutcometake an optionaldurationMs. The chain wrapper times each provider call;trackAiJobtimes the job and hands it to its failure line. A signal that cannot know a duration leaves the field out instead of claiming zero.codeis the OS error code behind the failure kind (empty for our own response timeout), the job line'scodethe job's closed code such asprovider_timeout.Tests: signal line duration, chain call timing under fake timers, job failure line timing (fails before the change).
Refs #1404