Skip to main content
All Docs
FeaturesmyProp (AgentOS People Portal)Updated April 4, 2026

Bug Fix: BFF company/urls/generic Was Returning the Wrong Data

Bug Fix: BFF company/urls/generic Was Returning the Wrong Data

Release: v0.1.91
Severity: High
Area: Backend for Frontend (BFF) · AgentOS integration


What happened

The POST /api/bff/company/urls/generic endpoint is responsible for returning company-level portal URL configuration from AgentOS — things like AgentLogoUrl and HomeUrls that the Vue SPA and Capacitor mobile app use to brand and navigate the portal.

Due to an incorrect wiring in the route handler, this endpoint was actually calling getCompanyBranches() internally, which hits:

GET /{clientName}/company/branches

This endpoint returns branch office records — a completely different data shape. The correct upstream call is:

GET /{clientName}/company/urls

Because the BFF returned a 200 OK either way, the mismatch was silent. The Vue SPA and Capacitor app were consuming branch records wherever URL configuration was expected, with no visible error.


What was fixed

The handler now calls the correct AgentOS endpoint directly:

// Before (incorrect)
const branches = await getCompanyBranches(clientName);
return bffSuccess(branches);

// After (correct)
const data = await letmcClient.get(
  `/${encodePath(clientName)}/company/urls`
);
return bffSuccess(data);

The unused getCompanyBranches import has been removed from the route file entirely.

A JSDoc comment has been added to the handler documenting the upstream endpoint and expected response fields:

/**
 * Fetch generic (company-wide) portal URLs from the AgentOS API.
 *
 * Original Lambda: GET /{clientName}/company/urls
 * Returns: URL map with AgentLogoUrl, HomeUrls, etc.
 * Request body: { clientName }
 */

Test coverage added

Two regression tests have been added to tests/app/api/bff/route.test.ts:

  1. Endpoint path test — asserts that calling POST /api/bff/company/urls/generic results in a single letmcClient.get call to /{clientName}/company/urls, and explicitly asserts the path does not contain /branches.

  2. Source validation test — reads the route file at test time and asserts that the string getCompanyBranches does not appear anywhere in it, preventing the dead import from being reintroduced.


Impact

SurfaceEffect
Vue SPANow receives correct portal URL mappings instead of branch records
Capacitor mobile appSame — correct URL config for logo and home URL routing
Public API surfaceNo change — handler path and request/response shape are unchanged
Downstream callersNo migration required

Related