Skip to content

[review] fix(claude): a claude-code agent on a Sylphx profile reaches its model with the profile key - #293

Queued
shtse8 wants to merge 3 commits into
mainfrom
triage/claude-sylphx-profile
Queued

shtse8 wants to merge 3 commits into
mainfrom
triage/claude-sylphx-profile

Conversation

@shtse8

@shtse8 shtse8 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Operator report #34 (eng-fun-big2-keel-dropin, 19:58Z): every claude-code sub-agent spawned with model
sylphx/openai/gpt-6.1-sol and profile sylphx/default failed with turn_state: errored, "Not logged in · Please
run /login" (4 of 4 spawns). The same spawns with claude-opus-5-5 on an anthropic/* profile worked.

Root cause

What is missing is AnyAgents' wiring, not support on the Sylphx side. A claude-code agent bound to a Sylphx profile
is started with no Sylphx base URL and no key, so Claude Code falls back to a Claude.ai sign-in the agent does not
have. Codex already gets the Sylphx base URL and profile key (resolve_sylphx_codex_provider); Claude Code never did.

What I checked:

  • Sylphx serves this route (verified live, using the sylphx/default key; the key never appeared in argv or
    output):
    • GET /v1/models returns 200 and lists openai/gpt-6.1-sol.
    • One POST /v1/messages for openai/gpt-6.1-sol, with bearer auth, stream: true and a tool definition, returns
      200: an SSE stream through message_stop, text "ok".
    • One more call, adding thinking, cache_control on system and user blocks, metadata, and an anthropic-beta
      header, also returns 200 and ends with end_turn.
  • The failing case: hkmt-keel-session-wire's transcript holds only two API errors, "Not logged in", and its Claude
    credential is a placeholder.

Fix

A claude-code agent bound to a Sylphx profile (.anyagents-profile = sylphx[/…]), or given a sylphx/... model,
starts with:

  • ANTHROPIC_BASE_URL: the Sylphx origin. It is read from the same place the codex wiring reads it, with /v1
    removed because Claude Code adds /v1/messages itself.
  • ANTHROPIC_AUTH_TOKEN: the profile's Sylphx key, resolved the same way as for codex and sent as a bearer token.
    A stray ANTHROPIC_API_KEY is dropped, so it cannot take precedence.
  • --model set to the id Sylphx serves: sylphx/openai/gpt-6.1-sol#high becomes openai/gpt-6.1-sol, and
    --effort high is kept.
  • ANTHROPIC_SMALL_FAST_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL set to the same id, so Claude Code's background
    calls do not ask Sylphx for a Claude id.

Agents on Anthropic profiles start exactly as before.

The first version of this PR (a refusal and a catalog change) is reverted. One part of it is kept: the explicit-profile
compatibility check now also runs before the agent row is written, so a creation it refuses leaves nothing to roll
back. A rollback deletes everything keyed by the agent, and until #289 lands that holds the Store writer. The
model-only check from the first version is dropped, because it made fresh installs stricter.

Tests

  • a_claude_code_agent_on_sylphx_reaches_it_with_the_profile_key:
    • an agent on a Sylphx profile gets the base URL, the token, the served model, the small/haiku model and the
      effort, and a leaked ANTHROPIC_API_KEY is dropped;
    • an agent with a Sylphx model but no profile takes the same route;
    • an agent on Anthropic gets none of it.
  • a_creation_its_profile_cannot_run_is_refused_and_leaves_no_agent.
  • cargo test -p anyagents --bin anyagents -- create:: vendor:: mcp_config::: 126 passed. Clippy -D warnings and
    cargo fmt --check are clean.

Live notes

  • No live claude-code agent is on Sylphx now: hkmt-keel-session-wire has since been moved to codex. The change takes
    effect for the next such spawn after deploy.
  • FYI only, not changed (security work is parked): profiles/sylphx/default/.claude/.credentials.json holds a stray
    Claude.ai OAuth credential.

… of failing every turn

Report #34: claude-code agents spawned with profile sylphx/default and model
sylphx/openai/gpt-6.1-sol failed every turn with "Not logged in". Sylphx
serves its models through an OpenAI-compatible API, and nothing gives Claude
Code a Sylphx sign-in or an Anthropic-compatible route for a profile; the
only Claude credential such an agent got was a stale or placeholder
claudeAiOauth copy. The provider catalog nevertheless listed claude-code and
claude-cloud as Sylphx-compatible, so spawn and switch accepted the pairing.

The Claude harnesses are dropped from the Sylphx defaults (a profile.json
that names them explicitly still wins), and a creation checks before its
row exists that the harness runs the profile, or without one the model's
provider, naming the harnesses that do.
… profile key

Review of #293: the refusal did nothing live (sylphx profile.json files list
claude-code explicitly) and its premise was wrong. Sylphx answers the
Anthropic Messages API at its origin: verified live with the sylphx/default
key, POST /v1/messages for openai/gpt-6.1-sol streams with tools, thinking,
cache_control and anthropic-beta headers. What was missing is AnyAgents: it
never gave Claude Code a Sylphx key and base URL, so Claude Code fell back to
a Claude.ai sign-in the agent did not have ("Not logged in", report #34).

A claude-code agent bound to a Sylphx profile, or given a sylphx/... model,
now starts with ANTHROPIC_BASE_URL (the Sylphx origin, from the same place
the codex wiring reads it), ANTHROPIC_AUTH_TOKEN (the profile key, same
resolution as codex), --model with the id Sylphx serves (sylphx/ prefix and
#effort removed) and its small/haiku model set to that id; a stray
ANTHROPIC_API_KEY is dropped for it. Agents on Anthropic start as before.

The catalog change is reverted. The early profile check is kept, for an
explicit profile only, so a creation it refuses writes no row to roll back;
the model-only check is dropped (it made fresh installs stricter).
@shtse8 shtse8 changed the title [review] fix(create): claude-code is refused a Sylphx profile or model instead of failing every turn [review] fix(claude): a claude-code agent on a Sylphx profile reaches its model with the profile key Nov 14, 2026
@shtse8
shtse8 added this pull request to the merge queue Nov 16, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 16, 2026
@shtse8
shtse8 added this pull request to the merge queue Nov 16, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 16, 2026
@shtse8
shtse8 added this pull request to the merge queue Nov 16, 2026
Any commits made after this event will not be merged.
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