Skip to content

Kai v2.5.0

Latest

Choose a tag to compare

@gertybot gertybot released this 01 Oct 03:00
· 16 commits to main since this release
c1733da

Indoor rides whose FIT file can't be decoded can now be analysed, through their TCX export. Nothing to change when upgrading from v2.4.0, except for people who copy the Garmin skill into their own agent (see below).

Added

  • garmin_activity_files.py reads TCX files (#36). parse, query and analyze accept .tcx (any case) and return the same fields as for FIT (timestamp, heart rate, distance, altitude, speed, power, cadence, position), plus a summary per lap. It uses only the standard library, so there is nothing new to install.
  • Why it matters: the FIT file of some indoor rides uploaded by third-party apps (seen with TrainingPeaks Virtual) can't be decoded by the FIT parser, so those activities couldn't be analysed at all. Their TCX export carries the full per-second data. To use it: garmin_activity_files.py download --activity-id <id> --format tcx, then analyze, parse or query the saved file.
  • analyze gives the same statistics from a TCX as from the FIT of the same activity.

Changed

  • When a FIT file can't be decoded, the error now says to download the same activity with --format tcx and parse that.
  • A TCX file that declares a DTD or XML entities is refused (a real one never does), which closes the usual XML entity-expansion trick. Files over 100 MB are refused before being read.

If you copied the Garmin skill into your own agent rather than tracking main: copy the updated skills/garmin-health-analysis/ folder, which includes the new TCX support and the assets/ folder from v2.4.0.

How it was checked

22 new offline tests (162 in total), including the same activity built as a FIT and as a TCX giving identical analyze output; fifteen deliberate breakages of the parser each fail a test. Against a real Garmin account: all 6 indoor rides that couldn't be analysed before now analyse and match Garmin's own summaries (distance within 2%, average heart rate within 3%, max heart rate exactly), and for 12 device-recorded activities across five types the FIT and TCX analyses of the same activity agree within 1%. A synthetic 100,000-point file (45 MB) parses in about 6.5 seconds. Not checked: TCX files from sources other than Garmin Connect.

Known issues

  • parse_gpx_file fails on GPX files that carry heart rate (14 of 16 activities in a sample), and analyze can't use GPX output (#42). Use TCX for analysis meanwhile.
  • query --time with a timestamp that has no timezone is read in the machine's local time; pass a Z or an offset.
  • The Hermes Agent and Codex setups are still untested against live installs.

Full changelog: v2.4.0...v2.5.0