data-api: route recap through context-aware resolution; make tests hermetic

main

Commit

toothbrush3mo ago

Audit of outbound API calls found newRecapClient still resolving its bearer via static auth.TokenForResource against the data host (api.BaseURL()), bypassing the discovery + context-selection path the other data-API commands use. Switch it to auth.ResolveDataAPIToken so recap follows the active auth context like activity/search/dispatch.

The audit also surfaced that the activity unit tests were no longer hermetic: now that activity/recap/search go through ResolveDataAPIToken, their resolution does a live /.well-known/entire-api.json fetch against the configured data host — which bypasses SetManagerForTest and hit the real entire.io once #2277 deployed. Add an explicit discovery seam (auth.SetResolveContextForAPIForTest / DiscoveryUnavailableForTest) and use it in the two runActivity tests so they exercise the static fallback through the singleton test manager with no network.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 3d80b3e46e06

Checkpoints

Auth Refactoring and Discovery Caching

Claude CodeOpus 4.8[1m]
View session
Checkpoint 1