fix(telemetry): create log file before opening write handle#17
Merged
Conversation
RealtimeTelemetry created the parent skilly/ directory but then called FileHandle(forWritingTo:), which throws if the file itself doesn't exist — so the very first run logged 'failed to open log file … doesn't exist' and dropped telemetry until a file happened to exist. Create an empty log file when missing. Additive; surfaced by the v1.10 silent-failure instrumentation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Small fix surfaced during the 8.2 validation run (and ironically by the v1.10 silent-failure instrumentation itself).
RealtimeTelemetry.openFile()created the parentskilly/directory but then calledFileHandle(forWritingTo:), which throws if the file itself doesn't exist. So on the very first run the console showed📊 Telemetry: failed to open log file … skilly-telemetry.jsonl doesn't existand telemetry was dropped until a file happened to exist.Fix: create an empty log file when missing, before opening the write handle. Additive, ~4 lines.
Validated:
swiftc -parseclean. (Full type-check needs an Xcode build — agents can't run xcodebuild/TCC — but this is an isolated FileManager change.)