Skip to content

fix: remove localhost agents-api bypass, use CMA for all agent calls [INTEG-3825]#10903

Open
ryunsong-contentful wants to merge 11 commits intomasterfrom
INTEG-3825
Open

fix: remove localhost agents-api bypass, use CMA for all agent calls [INTEG-3825]#10903
ryunsong-contentful wants to merge 11 commits intomasterfrom
INTEG-3825

Conversation

@ryunsong-contentful
Copy link
Copy Markdown
Contributor

@ryunsong-contentful ryunsong-contentful commented Apr 21, 2026

INTEG-3825

What & Why

The google-docs app previously had a LOCAL_AGENTS_API_BASE_URL flag hardcoded to http://localhost:4111. When set, all three agents-api functions — getWorkflowRun, startAgentRun, and resumeWorkflowRun — routed calls to a local dev server instead of the CMA. This was useful during development but needs to be removed before deploying to production.

This PR strips out all localhost branches so the app always goes through the CMA.

Changes

  • src/utils/constants/agent.ts — removed LOCAL_AGENTS_API_BASE_URL = 'http://localhost:4111'
  • src/services/agents-api.ts — removed all three if (LOCAL_AGENTS_API_BASE_URL) fetch branches, along with the now-unused AGENTS_API_HEADERS constant and getJsonHeaders() helper

All three functions now call the CMA directly:

Function CMA call
getWorkflowRun sdk.cma.agentRun.get
startAgentRun sdk.cma.agent.generate
resumeWorkflowRun sdk.cma.agentRun.resume

Test Plan

  • Start a workflow run in the deployed app — confirm no localhost:4111 calls appear in the network tab
  • Walk through the tabs/images suspend step and confirm startAgentRun + polling works via CMA
  • Walk through the mapping-review suspend step and confirm resumeWorkflowRun correctly calls sdk.cma.agentRun.resume
  • Confirm getWorkflowRun returns null gracefully on a NotFound error

Generated with Claude Code

@ryunsong-contentful ryunsong-contentful requested review from a team as code owners April 21, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant