Skip to content

[Bug] iOS Coach does not recognise a connected ChatGPT/Codex OAuth provider #774

Description

@HercoGC

HealthLog version

1.37.11 (build ca88d8c1a9cb)

Deployment type

Self-hosted (Docker)

What happened?

The ChatGPT Account (Codex OAuth) provider is connected on the server and passes the provider test. The web Coach works, and server-generated Daily Briefings are visible in the iOS app.

However, the iOS External AI Coach remains unavailable as though no supported provider is configured. Disconnecting and reconnecting the iOS app did not change the result.

This appears to be an iOS client/server capability mismatch rather than a failed provider connection. In v1.37.11, GET /api/user/ai-provider exposes effective availability through aiAvailable and managedBy, and CHATGPT_OAUTH is a supported provider type.

Expected behavior

The iOS Coach should recognise and use the working server-side ChatGPT/Codex OAuth provider without requiring a separate OpenAI API key on the phone.

If this provider is intentionally unsupported by the native Coach, the iOS screen should explain that specific limitation instead of reporting that no provider is configured.

Steps to reproduce

  1. Self-host HealthLog v1.37.11 with Docker.
  2. In the web app, connect ChatGPT Account (Codex) under AI provider settings.
  3. Confirm that Test active provider succeeds and the web Coach responds.
  4. Sign in to HealthLoger 0.17.0 using the same server.
  5. Confirm that server-generated Daily Briefings appear in HealthLoger.
  6. Open the iOS External AI Coach.
  7. Observe that the Coach is unavailable as though no supported provider exists.
  8. Disconnect and reconnect the iOS app; the state remains unchanged.

Workaround used

Use the web Coach on the Mac for conversations. HealthLoger can still sync HealthKit data and display server-generated Daily Briefings. Reconnecting the iOS app was tested but did not restore the External AI Coach.

Possible solution

  • Gate native Coach availability on the API's effective aiAvailable value rather than requiring a non-null legacy provider or API-key field.
  • Treat CHATGPT_OAUTH as available when the server reports aiAvailable: true, including the valid case where the stored provider selection is null but connected Codex tokens are resolved by the server.
  • Add an iOS contract test for a response such as provider: null, aiAvailable: true, managedBy: "user".
  • If the native Coach cannot support this provider, return and display an explicit unsupported-provider reason.

Relevant logs / screenshots

No public logs or screenshots are attached because they contain private server and account metadata. The server provider test succeeds.

Browser / OS (if applicable)

HealthLoger 0.17.0 (TestFlight) on iOS 27; server hosted on macOS 27 arm64.

Pre-flight checks

  • I confirmed this is not a duplicate of an existing issue.
  • I redacted any secrets, tokens, or personal data from logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions