anhtnm1andClaude Opus 5 96bec976e7 feat(R03): unify provider catalogue, routing decisions and usage telemetry
EPIC R03 (Team Duy) - one provider catalogue, one routing flow, one usage seam.

R03-T01 tests/contracts/test_providers.py
  29 contract tests every provider must satisfy: canonical assistant message,
  streamed text == returned content, reasoning never joins the answer, parsed
  tool arguments, ProviderError for every failure. Real adapters exercised
  offline by stubbing Provider._request.
R03-T02 domain/models/provider_descriptor.py
        infrastructure/providers/provider_registry.py
  Provider facts declared once (was split across providers/factory.py,
  DEFAULT_CONFIG and PROVIDER_LABELS). ProviderRegistry.build() also stamps the
  descriptor id onto the instance, so ollama/github_copilot/codex usage is no
  longer all attributed to "openai_compat", and never mutates the caller config.
R03-T03 application/model_routing/routing_application_service.py
  Pure-Python routing policy with four modes: Off, Auto, Manual and the new
  Fallback (switch only AFTER the current model fails). Depends on a RoutingPort
  protocol; production wires the existing core.routing engine underneath.
R03-T04/T05 ui/chat_panel.py, ui/co4e_tab.py, ui/folder_tab.py
  Three near-identical routing copies (~40 lines each) replaced by a call to
  ctx.routing_application() plus a confirm callback. Mode vocabulary now lives
  in one place (normalize_mode/is_valid_mode) instead of four literal tuples.
R03-T06 infrastructure/telemetry/usage_sink.py
  Token usage extracted from both providers into UsageEvent + UsageEventSink.
  Estimation pinned against core.usage_tracker so no recorded number changes.

Also fixes a deadlock introduced while wiring AppContext: routing_application()
held _routing_lock and called routing(), which takes the same non-reentrant lock.

Suite: 186 passed, 1.22s. check_imports: PASS. All new files < 400 LOC.
2 pre-existing failures remain in test_config_security.py (EPIC R02/Team Nam).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 10:22:28 +09:00
2026-08-20 12:12:56 +00:00
2026-08-20 12:12:56 +00:00
2026-08-20 12:12:56 +00:00
2026-08-20 12:12:56 +00:00
2026-08-20 12:12:56 +00:00
2026-08-20 12:12:56 +00:00

Cowork Local

Cowork Local is the internal AI cowork desktop platform owned by the Cowork Team. It provides the Cowork runtime, workspace and agent experiences, MCP/connectors, security controls, and model routing foundation.

The Cowork Team owns this product and its stable branch. The FSG AI Core Team contributes selected reusable capabilities through branches and Pull Requests; it is not the owner or final merger of this repository.

Quick start

The imported application is a Python/PySide6 package. Run it from the directory that contains cowork_local:

python -m cowork_local

The source snapshot does not include a complete runtime dependency manifest. Use the Cowork Team's supported runtime environment until that packaging contract is documented. The reliable automated test surface currently checked by CI is:

python -m pip install -r cowork_local/requirements-test.txt
python -m pytest cowork_local/tests -q

When already inside this repository, run python -m pytest tests -q.

Configuration and runtime data live under ~/.cowork_local/. Provider keys and local unlock codes must be supplied through environment variables or an approved secret manager; see .env.example.

Contributing

Start with START_CONTRIBUTING.md, then read CONTRIBUTING.md. Core AI task execution remains in fsg-ai-core-assets; source changes are reviewed as Pull Requests in this repository.

Security concerns should follow SECURITY.md. Ownership and completion rules are documented under docs/governance/.

S
Description
Cowork Local — internal AI cowork platform and shared foundation for FSG AI capabilities.
Readme
34 MiB
Languages
Python 97.8%
HTML 1.7%
Batchfile 0.4%