Files
ccs/ui
Kenneth Wong 2b780ceae3 fix(extended-context): never write [1m] into the Fable tier key
Claude Code resolves ANTHROPIC_DEFAULT_FABLE_MODEL through a resolver that
strips the [1m] suffix before use, unlike the opus/sonnet resolvers which
pass their env value through untouched. The stripped value is then treated
as an env-supplied default and held to the standard 200k window instead of
the model's native 1M, so writing [1m] into that key costs the long context
window rather than granting it.

Measured against a Claude Code 2.1.259 session (`/context` on a live proxy
endpoint):

  ANTHROPIC_MODEL=claude-fable-5-1[1m]               -> 1m window
  ANTHROPIC_MODEL=claude-fable-5-1                   -> 200k window
  ANTHROPIC_DEFAULT_FABLE_MODEL=claude-fable-5-1[1m] -> 200k window

The fix is key-scoped rather than model-scoped, since the suffix is what
grants 1M on every other key. Adds envKeyAcceptsExtendedContextSuffix() as
the single place recording which keys reject the suffix, enforces it as a
floor inside applyExtendedContextPreferenceToAnthropicModels() so no caller
can bypass it, and strips a previously saved suffix from that key on the
next launch through the auto path.

Also extends the preference to CLAUDE_CODE_SUBAGENT_MODEL. Subagent windows
come from the same resolver as the main loop (the Explore inheritCap bounds
the model tier, not the context window), so a bare subagent model id sits at
200k while the suffixed form gets 1M. The new key list is kept separate from
ANTHROPIC_MODEL_ENV_KEYS, which also drives routing, model-id normalization
and profile validation.

Claude-Session: https://claude.ai/code/session_01NPkafQjVf4pSwPBwBistGk
2026-09-03 17:08:23 +08:00
..

CCS Dashboard UI

React, TypeScript, and Vite frontend for the local dashboard served by the CCS web server through:

ccs config

Development

From the repository root, build the server and open the integrated dashboard:

bun run dev

Pass a host explicitly when testing network access:

bun run dev -- --host 0.0.0.0
bun run dev -- --host 127.0.0.1

For the frontend-only Vite server:

cd ui
bun run dev

Root and UI scripts are defined in ../package.json and package.json.

Source Ownership

Area Path
Route-level pages src/pages/
Domain and shared components src/components/
Server-state hooks src/hooks/
Cross-page context/providers src/contexts/ and src/providers/
API, localization, catalogs, helpers src/lib/
UI tests tests/ and colocated tests

Follow the owning domain's existing import pattern. Barrel exports are optional, not required at every directory level.

Quality Commands

cd ui
bun run format
bun run typecheck
bun run lint
bun run validate
bun run test:run

bun run validate currently runs typecheck, lint with fixes, and the format check. UI tests run with Vitest; use test, test:run, test:coverage, or test:ui as defined in package.json.

Localization

Dashboard localization uses react-i18next.

Concern Source
Supported locales, normalization, fallback, persistence src/lib/locales.ts
i18next setup and translation resources src/lib/i18n.ts
Language switcher src/components/layout/language-switcher.tsx

English is the fallback. The selected locale is stored in browser local storage under ccs-ui-locale. Treat src/lib/locales.ts as the complete source of truth for supported locale codes. When adding or removing a locale, update the translation resources, switcher, tests, and dashboard i18n guide in the same change.