Skip to content

fix(skills): default FDv2SkillStore endpoints from LD_BASE_URI and LD_STREAM_URI - #134

Open
XieX wants to merge 4 commits into
mainfrom
xie/fdv2-endpoint-env
Open

XieX wants to merge 4 commits into
mainfrom
xie/fdv2-endpoint-env

Conversation

@XieX

@XieX XieX commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

initClient() reads LD_BASE_URI / LD_STREAM_URI for the base SDK, but FDv2SkillStore always defaulted to the production hosts. A process pointed at catfood, staging or a private instance by its environment resolved flags there, then sent skill delivery to production with a non-production key. That shows up as a fatal 401 in store.failed, not as a configuration error.

With neither URI option given, the constructor now reads both variables in their place, once:

  • A lone LD_BASE_URI moves both endpoints, under the store's existing rule for a lone baseUri. This differs on purpose from initClient(), where flag streaming stays on its default host.
  • An option given turns the environment off for both endpoints, so an explicit host is never mixed with one from the environment.
  • A blank value counts as unset.
  • A refused, non-https value is reported under the variable's name.
  • SKILLS_DEFAULT_BASE_URI / SKILLS_DEFAULT_STREAM_URI keep the production values as the fallback.

The client README and agents.md are updated.

Spec: TESTING.md §3.25 and A.12, in launchdarkly/ai-sdks-monorepo#59.

Tests: new cases in the endpoints block of skills-fdv2.test.ts. That block now clears both variables around each test, so a developer shell can't move the default-host assertions. The 371 FDv2 tests pass.

CI on main is already red: makeGraphTrackData, added in #101, is missing from the root-export snapshot in packages/client/src/__tests__/skills.test.ts. That failure shows up here too, and is being fixed separately.

Found while dogfooding AgentControl (Queenbee) on staging.

🤖 Generated with Claude Code


Note

Overview
FDv2SkillStore now honors the same host overrides as initClient() when you do not pass baseUri or streamUri. Staging or private deployments that only set LD_BASE_URI / LD_STREAM_URI previously evaluated flags against the right instance but pulled skills from production (often surfacing as a fatal 401 instead of a config error).

With no URI options, the constructor reads LD_BASE_URI and LD_STREAM_URI once at construction (blank values count as unset). A lone LD_BASE_URI drives both poll and stream, matching the store’s lone-baseUri rule—unlike initClient(), where streaming stays on the default host unless LD_STREAM_URI is set. Passing either URI option disables env for both endpoints so explicit and env hosts are never mixed. Invalid non-HTTPS values fail with errors that name the env variable.

Docs (README, agents.md) and endpoint tests (including isolating env in the test block) cover the new behavior.

Reviewed by Cursor Bugbot for commit c586bbe. Bugbot is set up for automated code reviews on this repo. Configure here.

XieX and others added 2 commits October 14, 2026 13:40
…_STREAM_URI

`initClient()` reads LD_BASE_URI / LD_STREAM_URI for the base SDK, but
FDv2SkillStore defaulted to the production hosts. A process pointed at
catfood, staging or a private instance by its environment resolved flags
there and sent skill delivery to production with a non-production key,
which surfaces as a fatal 401 in `store.failed` rather than as a
configuration error.

With neither URI option given, the constructor now reads both variables
in their place, once. They follow the store's own rule (a lone base URI
moves both endpoints), blank counts as unset, an option given turns the
environment off for both, and a refused value names the variable.
SKILLS_DEFAULT_BASE_URI / SKILLS_DEFAULT_STREAM_URI keep the production
values as the fallback.

Spec: TESTING.md §3.25 and A.12 in launchdarkly/ai-sdks-monorepo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jeffdupont and others added 2 commits October 23, 2026 12:04
…int docs

The new doc lines on FDv2SkillStoreOptions shift the Requester forgotten-export reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeffdupont
jeffdupont requested a review from a team as a code owner October 23, 2026 19:10
@jeffdupont

Copy link
Copy Markdown
Contributor

Merged main in and regenerated packages/client/etc/ai-server-experimental.api.md (c586bbe). The new doc lines on FDv2SkillStoreOptions move the Requester forgotten-export reference from skills-fdv2.d.ts:454 to :460. Locally, typecheck/api:check pass and client tests pass (1837 passed). This needs a human reviewer; the Python twin, python-ai-sdk#207, is already approved.

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.

2 participants