Skip to content

Drop the BFF fallback for activity and recap - #2717

Open
Soph wants to merge 1 commit into
mainfrom
soph/drop-bff-me-fallbacks
Open

Soph wants to merge 1 commit into
mainfrom
soph/drop-bff-me-fallbacks

Conversation

@Soph

@Soph Soph commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

https://entire.io/gh/entireio/cli/trails/1532

What

entire activity and entire recap now talk only to the caller's home entire-api cell. The data-API (BFF) fallback is removed.

Why

Both commands tried the home cell first and fell back to the BFF when the cell client could not be built. The BFF serves /me/activity, /me/commits and /me/recap by proxying to that same home cell (proxyHomeMe in entire.io), so the fallback could never succeed where the cell path failed. It only added a hop and hid the real error behind a later 401.

Changes

  • runAuthenticatedActivityAPI (entireapi_client.go) and newRecapClient (recap.go) build the client with auth.NewEntireAPICellClient and nothing else.
  • Client-construction errors go through renderDataAPIAuthError: no login prints the login hint (recap used to render the BFF's 401 instead), the caller's own cancellation stays silent, and anything else, including a home jurisdiction without a cell, surfaces verbatim.
  • runAuthenticatedDataAPI, logCellClientFallback and currentRepoSlug lost their last callers and are removed.
  • docs/development/api-routing.md documents /me routing as home cell with no fallback.

Tests

  • Activity and recap tests now stub the cell path (SetResolveContextForCellAPIForTest) and isolate config/cache dirs and ENTIRE_TOKEN, so they no longer reach real discovery.
  • New TestRunRecap_PrintsLoginHintWhenNotLoggedIn covers the not-logged-in path.
  • mise run check passes.

Note

Medium Risk
Changes auth and API routing for user-facing activity/recap commands; failures that previously succeeded via BFF fallback may now error or show different messages.

Overview
Activity and recap now authenticate only against the caller鈥檚 home entire-api cell via auth.NewEntireAPICellClient; the previous data-API/BFF fallback (runAuthenticatedDataAPI, ResolveDataAPI, and logCellClientFallback) is removed because the BFF proxies /me/* to that same cell.

Client build failures go through renderDataAPIAuthError: ErrNotLoggedIn shows the login hint, Ctrl+C stays silent, and other errors (no cell for jurisdiction, refresh/network) surface directly instead of being masked or deferred to a server 401. Recap repo scope is always the cell path (repo ULID from currentRepoRef); slug-based data-API scoping and currentRepoSlug are dropped.

Tests switch to SetResolveContextForCellAPIForTest with isolated config dirs; recap adds a not-logged-in hint test. api-routing.md documents the no-fallback /me routing.

Reviewed by Cursor Bugbot for commit c557cbc. Configure here.

entire activity and entire recap tried the caller's home entire-api cell
first and fell back to the data API (the BFF) when the cell client could
not be built. The BFF serves /me/activity, /me/commits and /me/recap by
proxying to that same home cell (proxyHomeMe), so the fallback could
never succeed where the cell path failed; it only added a hop and hid
the real error.

Both commands now use the home cell only. Client errors go through
renderDataAPIAuthError: no login prints the login hint (recap used to
render the BFF's 401 instead), cancellation stays silent, and anything
else, including a home jurisdiction without a cell, surfaces verbatim.
runAuthenticatedDataAPI, logCellClientFallback and currentRepoSlug lose
their last callers and are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 01M4GNVFC303Y9TKGWSAWCAKBN
Copilot AI balanced review requested due to automatic review settings October 9, 2026 15:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃煝 Approval recommended

The implementation consistently removes the fallback while preserving authentication error handling and relevant test coverage.

0 open findings

What changed in this PR

Routes activity and recap directly through the caller鈥檚 home Entire API cell, removing the redundant BFF fallback.

Changes:

  • Removed data-API fallback and fallback logging.
  • Standardized authentication error rendering.
  • Updated recap scoping, tests, and routing documentation.
File Description
docs/鈥媎evelopment/鈥媋pi-routing.md Documents cell-only /me routing.
cmd/鈥媏ntire/鈥媍li/鈥媟ecap.go Uses the home-cell client and repo ULID scope.
cmd/鈥媏ntire/鈥媍li/鈥媟ecap_test.go Updates routing seams and tests login guidance.
cmd/鈥媏ntire/鈥媍li/鈥媏ntireapi_client.go Removes activity fallback behavior.
cmd/鈥媏ntire/鈥媍li/鈥媋uthcmd.go Removes the obsolete data-API authentication helper.
cmd/鈥媏ntire/鈥媍li/鈥媋uth/鈥媍ell_data_api.go Updates no-cell error documentation.
cmd/鈥媏ntire/鈥媍li/鈥媋ctivity_cmd_test.go Tests activity against cell authentication.

馃 Review effort: Balanced


馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Soph
Soph marked this pull request as ready for review October 9, 2026 18:07
@Soph
Soph requested a review from a team as a code owner October 9, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants