GeezerVison is showing github.com — feat(garmin_connect): add a VO2 max action by prkomb · Pull Request #919 · oomol-lab/open-connector
Conversation
Adds list_vo2_max to the Garmin Connect provider. Garmin added a daily VO2 max endpoint to the Personal API, GET /metrics-service/metrics/maxmet/daily/{startDate}/{endDate}, and wrapped it in its own Python client on 12 November (garmin/connect-personal-api-python#3). VO2 max is one of the first numbers people ask an agent about when they look at their training, so it seemed worth its own action.
Each day in the response holds a generic estimate plus cycling and rowing ones. Every estimate has calendarDate, vo2MaxValue (a whole number, as Garmin Connect shows it), vo2MaxPreciseValue, and the sport and subSport of the activity it came from. Those last two are not in Garmin's schema yet, but they come back on every estimate, so the output schema declares them as nullable strings. Days without an estimate are left out, and an empty range is [].
A few behaviours shaped the code:
- Garmin documents no range limit for this endpoint, but it answers HTTP 400 with an empty
{} to a span of 368 days or more. The action keeps to 366 days, as list_daily_summaries does, and checks the span before calling, so an agent gets the message telling it to split the range instead of a bare 400.
- An end date before the start date gets an HTTP 500 from Garmin; the existing date-range check rejects it first.
- The spec describes
sport as a list, but Garmin only reads it as repeated parameters (sport=RUNNING,CYCLING is a 400), so the action takes one sport per call. Lower-case names such as running work too.
Testing:
- Ran
list_vo2_max through the provider's handler against a real Garmin account: an empty month ([]), a full 366-day range with estimates, and a sport filter, and validated every response against the output schema. A 367-day range and a reversed range are rejected locally, without a request.
npm run fix-check, npm run lint, npm run format, npm run build:web, and npm run generate:catalog with scripts/check-action-examples.ts (22,232 passed) pass. The full npm test passes apart from sftp/runtime.test.ts > creates, renames and removes entries, which times out the same way on main on my machine, and two shutdown-timeout tests in postgres/runtime-store.test.ts that only time out under the full run and pass on their own.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 17, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Summary by CodeRabbit
- New Features
- Added access to daily VO₂ max estimates from Garmin Connect, including general, cycling, and rowing results.
- Results can be requested for a date range of up to 366 days, with an optional sport filter. Estimates are provided by day, and values may be unavailable for some dates.
Walkthrough
The Garmin Connect provider adds the list_vo2_max read action. It accepts an inclusive date range, limited to 366 days, and an optional sport filter. The action requests daily max-met estimates and returns validated days containing general, cycling, and rowing estimates. The provider description now includes VO2 max.
Sequence Diagram(s)
sequenceDiagram
participant Caller
participant list_vo2_max
participant GarminConnectAPI
Caller->>list_vo2_max: Provide date range and optional sport
list_vo2_max->>GarminConnectAPI: Request daily max-met estimates
GarminConnectAPI-->>list_vo2_max: Return estimate response
list_vo2_max-->>Caller: Return validated days
Loading
Possibly related PRs
Merge Risk: Minimal · up to e4a60
-
This adds a read-only Garmin VO2 max listing action with local date-range validation. No concrete merge-blocking risk was found.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title follows the required format feat(garmin_connect): add a VO2 max action, uses the type and scope, and is in English. It clearly names the main change, which adds the list_vo2_max action to … |
| Description check |
 |
The description explains that the change adds list_vo2_max to the Garmin Connect provider, names the daily VO2 max endpoint, and describes the output fields, the 366-day limit, the sport filter, and t… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title follows the required format feat(garmin_connect): add a VO2 max action, uses the type and scope, and is in English. It clearly names the main change, which adds the list_vo2_max action to the Garmin Connect provider.
Full details: Description check
-
Explanation
The description explains that the change adds list_vo2_max to the Garmin Connect provider, names the daily VO2 max endpoint, and describes the output fields, the 366-day limit, the sport filter, and the testing performed. It matches the changeset.
Finishing Touches
-
Simplify code
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI; Enforced overrides: Organization
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9277d269-27b8-4c4c-aa92-b3beb0236d81
Commits
-
Reviewing files that changed from the base of the PR and between e8d7fa4 and e4a603a.
Files selected for processing: 4
-
src/providers/garmin_connect/actions.ts
src/providers/garmin_connect/definition.ts
src/providers/garmin_connect/limits.ts
src/providers/garmin_connect/runtime.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
PR Summary by Qodo
Add Garmin Connect VO2 max listing action
✨ Enhancement 🕐 10-20 Minutes

AI Description
-
• Add a VO2 max action with daily general, cycling, and rowing estimates and an optional sport
filter.
• Reject reversed or overlong date ranges before Garmin returns an unhelpful error.
• Describe the new capability in the Garmin Connect provider catalog.
Merge Risk 🟢 Low
-
Evidence: Partial. The supplied snapshot does not establish the exact base and head revision identifiers for reconstructing the full git diff. The listed changed-file inventory and current source were inspected. Garmin's external endpoint contract is represented by repository comments and implementation assumptions; no external repository or pinned provider specification was available for independent verification. The provider did not establish the exact full-PR diff revisions. The report lists 17 more gaps.
Blast radius 🟢 Low 💥 1 capability
-
- 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
- This is one end-to-end read behavior within the Garmin Connect wellness-data integration: the public action contract, provider executor registration, authenticated Garmin request, and returned VO2 max records are all parts of the same bounded integration.
- No independent consumer or separate functional subsystem was found in the repository; the runtime and schema are implementation hops of this capability.
Sources
-
src/providers/garmin_connect/actions.ts[302-305]
defineProviderAction(service, {
name: "list_vo2_max",
operationType: "read",
description: `List the user's VO2 max estimates for a range of days: the general estimate and the cycling and rowing estimates, each with the sport of the activity it came from. Garmin lists only days that have an estimate. The range may span at most ${garminConnectMaxRangeDays.vo2Max} days.`,
src/providers/garmin_connect/actions.ts[306-322]
inputSchema: s.object(
"The inclusive range of days to read.",
{
startDate: s.date("The first calendar date to include, in YYYY-MM-DD, on the user's local calendar."),
endDate: s.date(
`The last calendar date to include, in YYYY-MM-DD. It must not be before startDate. The range may span at most ${garminConnectMaxRangeDays.vo2Max} days, both ends included.`,
),
sport: s.string(
"Only estimates from activities of this sport, such as RUNNING or CYCLING, as named in the Garmin FIT SDK. One sport per request.",
),
},
{ required: ["startDate", "endDate"] },
),
outputSchema: s.object("The VO2 max estimates returned by Garmin Connect.", {
days: s.array("One entry per day that has an estimate; each estimate carries its calendarDate.", vo2MaxDaySchema),
}),
}),
src/providers/garmin_connect/actions.ts[110-126]
function vo2MaxEstimateSchema(description: string): JsonSchema {
return s.nullable(
s.looseObject(description, {
calendarDate: s.date("The calendar date of the estimate."),
vo2MaxValue: s.nullableNumber("VO2 max in mL/kg/min, rounded to a whole number as Garmin Connect shows it."),
vo2MaxPreciseValue: s.nullableNumber("VO2 max in mL/kg/min before rounding."),
sport: s.nullableString("The sport of the activity the estimate came from, such as RUNNING or CYCLING."),
subSport: s.nullableString("The sub-sport of that activity, such as GENERIC or INDOOR_CYCLING."),
}),
);
}
const vo2MaxDaySchema = s.looseObject("The VO2 max estimates Garmin holds for one day.", {
generic: vo2MaxEstimateSchema("The general VO2 max estimate. Null when Garmin has none for the day."),
cycling: vo2MaxEstimateSchema("The cycling VO2 max estimate. Null when Garmin has none for the day."),
rowing: vo2MaxEstimateSchema("The rowing VO2 max estimate. Null or absent when Garmin has none for the day."),
});
Behavioral complexity 🟢 Low 🧩 Straightforward
-
- Before: the provider already used the established action-schema, date-range validation, authenticated GET, and responseList pipeline for other read-only Garmin ranges.
- After: this change adds one analogous action, one maxmet URL, one optional sport query parameter, and a VO2 max output schema.
- New correctness condition: the selected Garmin endpoint and its daily response must map to the declared days/list shape while respecting the 366-day inclusive bound.
- The change does not introduce coordinated writes, concurrency, persistence, migrations, or a new state protocol; it reuses the existing validation and response conversion infrastructure.
Sources
-
src/providers/garmin_connect/actions.ts[306-322]
inputSchema: s.object(
"The inclusive range of days to read.",
{
startDate: s.date("The first calendar date to include, in YYYY-MM-DD, on the user's local calendar."),
endDate: s.date(
`The last calendar date to include, in YYYY-MM-DD. It must not be before startDate. The range may span at most ${garminConnectMaxRangeDays.vo2Max} days, both ends included.`,
),
sport: s.string(
"Only estimates from activities of this sport, such as RUNNING or CYCLING, as named in the Garmin FIT SDK. One sport per request.",
),
},
{ required: ["startDate", "endDate"] },
),
outputSchema: s.object("The VO2 max estimates returned by Garmin Connect.", {
days: s.array("One entry per day that has an estimate; each estimate carries its calendarDate.", vo2MaxDaySchema),
}),
}),
src/providers/garmin_connect/actions.ts[110-126]
function vo2MaxEstimateSchema(description: string): JsonSchema {
return s.nullable(
s.looseObject(description, {
calendarDate: s.date("The calendar date of the estimate."),
vo2MaxValue: s.nullableNumber("VO2 max in mL/kg/min, rounded to a whole number as Garmin Connect shows it."),
vo2MaxPreciseValue: s.nullableNumber("VO2 max in mL/kg/min before rounding."),
sport: s.nullableString("The sport of the activity the estimate came from, such as RUNNING or CYCLING."),
subSport: s.nullableString("The sub-sport of that activity, such as GENERIC or INDOOR_CYCLING."),
}),
);
}
const vo2MaxDaySchema = s.looseObject("The VO2 max estimates Garmin holds for one day.", {
generic: vo2MaxEstimateSchema("The general VO2 max estimate. Null when Garmin has none for the day."),
cycling: vo2MaxEstimateSchema("The cycling VO2 max estimate. Null when Garmin has none for the day."),
rowing: vo2MaxEstimateSchema("The rowing VO2 max estimate. Null or absent when Garmin has none for the day."),
});
src/providers/garmin_connect/limits.ts[24-27]
dailySummaries: 366,
sleepSummaries: 31,
bodyBattery: 31,
vo2Max: 366,
Potential damage 🟡 Medium 🩹 Temporary loss
-
- A wrong endpoint assumption, unsupported request combination, or incompatible response shape can make the newly added VO2 max read unavailable or return no usable result.
- This affects one read capability in the Garmin Connect wellness-data integration, not persistent Garmin data: the handler is a single GET and the provider is documented as read-only.
- Reverting the deployment restores the prior provider behavior, but a user cannot obtain VO2 max data through this action until the endpoint contract or implementation is corrected.
- Recoverable by correcting or reverting the provider code and retrying the read.
- No persistent state repair or external compensation is required because the changed path performs no writes.
- Automatic retry or fallback for this new operation is not established by the inspected source.
Sources
-
src/providers/garmin_connect/runtime.ts[81-84]
/**
* Action handlers for every Garmin Connect action. Each one is a single GET
* against the Personal API, which has no write endpoints.
*/
Assessed commit e4a603a
> Snapshot assessment: the current PR revision could not be verified.
Diagram
-
sequenceDiagram
actor Caller
participant Action as VO2 Max Action
participant Range as Date Range Check
participant Client as Garmin Client
participant API as Personal API
Caller->>Action: Dates and optional sport
Action->>Range: Validate inclusive span
Range-->>Action: Valid range
Action->>Client: Request daily estimates
Client->>API: GET maxmet daily
API-->>Client: Estimate list
Client-->>Action: Parsed response
Action-->>Caller: Days with estimates
Loading
High-Level Assessment
-
The dedicated action is appropriate: it exposes a distinct Garmin metric while reusing the provider's date-range validation and authenticated GET path. Folding it into daily summaries would obscure its separate endpoint and sport filter.
Files changed (4) +55 / -1
-
Enhancement (2) +47 / -0
-
actions.tsDefine the VO2 max action and response schema +39/-0
Define the VO2 max action and response schema
• Adds an optional single-sport filter and an inclusive date range to 'list_vo2_max'. Describes daily general, cycling, and rowing estimates, including nullable measurements and activity sport metadata.
src/providers/garmin_connect/actions.ts
runtime.tsFetch daily VO2 max estimates +8/-0
Fetch daily VO2 max estimates
• Adds a handler that validates the range before calling Garmin's daily maxmet endpoint with an optional sport parameter. It returns the response as 'days', including an empty array for an empty response.
src/providers/garmin_connect/runtime.ts
Documentation (1) +1 / -1
-
definition.tsAdvertise VO2 max in the provider description +1/-1
Advertise VO2 max in the provider description
• Adds VO2 max to the Garmin Connect provider's listed read capabilities.
src/providers/garmin_connect/definition.ts
Other (1) +7 / -0
-
limits.tsSet a 366-day VO2 max range limit +7/-0
Set a 366-day VO2 max range limit
• Adds a shared limit for the action schema and handler, with a comment explaining Garmin's empty HTTP 400 response to longer spans.
src/providers/garmin_connect/limits.ts
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Code Review by Qodo
🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)


Great, no issues found!
Qodo reviewed your code and found no material issues that require review

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR
More tips ↗ | Customize Qodo ↗ | Qodo docs ↗


|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ No new issues found.
Reviewed changes
- New
list_vo2_max action — reads GET /metrics-service/metrics/maxmet/daily/{startDate}/{endDate} with a required date range and an optional single sport filter, returning { days } directly from Garmin's list response.
- Range guard —
garminConnectMaxRangeDays.vo2Max (366) is passed to the shared readDateRange, so an over-long span is rejected locally with the split-the-range message, and the action description quotes the same constant.
- Output contract — nullable
generic/cycling/rowing loose objects documenting calendarDate, vo2MaxValue, vo2MaxPreciseValue, sport and subSport.
- Provider description — now lists VO2 max alongside the other data sets.
The handler reuses the provider's existing readDateRange, responseList and getGarminConnect helpers, and queryParams drops an unset sport value, so the request is unchanged when the filter is omitted. npm run build, npm run generate:catalog with scripts/check-action-examples.ts, the provider-source-guards suite, oxfmt --check and oxlint all pass in this run.
| View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|