Commit Graph

721 Commits

Author SHA1 Message Date
Alishahryar1 d0929b2771 Fix stream recovery edge cases 2026-06-27 02:37:11 -07:00
Alishahryar1 485ad80afe Fix stream recovery review findings 2026-06-27 01:22:31 -07:00
Alishahryar1 455a8d4cfc Guard stream recovery terminal ordering 2026-06-27 00:51:07 -07:00
Alishahryar1 776cff6329 Simplify tool stream ledger ownership 2026-06-25 23:49:42 -07:00
Alishahryar1 9203d52784 Guard midstream error terminal events 2026-06-25 22:35:22 -07:00
Alishahryar1 6682e71476 Require terminal markers for recovery streams 2026-06-25 22:05:58 -07:00
Alishahryar1 ead3c9d45d Fix emitted tool stream ledger state 2026-06-24 23:36:43 -07:00
Alishahryar1 613e2076cf Fix stream ledger recovery edge cases 2026-06-24 23:15:25 -07:00
Alishahryar1 2d4ea0b337 Refactor provider stream engine 2026-06-24 23:15:25 -07:00
Ali Khokhar d281d52ced Refactor messaging around explicit ports (#878) 2026-06-20 09:35:38 -07:00
Alishahryar1 acf5885b16 Fix Windows installer uv version parsing 2026-06-19 14:03:30 -07:00
Ali Khokhar d9e42457bc Fix Claude auto-mode classifier thinking policy (#865) 2026-06-19 12:24:56 -07:00
dependabot[bot] 61b444ed79 build(deps): bump the minor-and-patch group across 1 directory with 11 updates (#846)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ali Khokhar <alishahryar2@gmail.com>
2026-06-18 18:38:56 -07:00
Ali Khokhar 6bee3104fe Refactor CLI surfaces around launchers and managed Claude (#861)
## Problem

The CLI package preserved a generic adapter layer and managed Codex
parser path that did not match the supported customer workflows.
Messaging runs Claude Code sessions, while Codex is supported through
`fcc-codex` and extensions.

## Changes

| Before | After |
| --- | --- |
| `fcc-claude` and `fcc-codex` shared generic adapter plumbing. |
`fcc-claude` and `fcc-codex` use explicit launcher modules. |
| Messaging depended on a generic CLI session abstraction. | Messaging
depends on managed Claude Code sessions. |
| Codex catalog generation lived as a top-level CLI helper. | Codex
catalog generation lives under the Codex launcher owner. |
| Tests asserted deleted internal adapter shapes. | Tests assert
launcher, managed-Claude, and customer-surface behavior. |
2026-06-18 18:36:37 -07:00
Alishahryar1 e24711af3f Make local CI scripts autofix Ruff issues 2026-06-18 18:17:31 -07:00
Ali Khokhar b3ac9c2e5e Add Responses reasoning usage details (#860)
## Problem

Codex receives reasoning text from the Responses stream, but FCC does
not emit reasoning-token usage details. Codex reports zero reasoning
tokens even when thinking is present.

## Changes

| Before | After |
| --- | --- |
| Responses usage reported only input, output, and total tokens. |
Responses usage reports input, output, total, and reasoning-token
details when reasoning text exists. |
| Reasoning text had no adapter-owned token estimate. | Reasoning text
gets a Responses-owned best-effort token estimate. |
| Reasoning estimates could exceed reported output tokens. | Reasoning
estimates are capped at reported output tokens. |
| Text-only Responses usage kept the base shape. | Text-only Responses
usage keeps the base shape. |
2026-06-18 16:39:27 -07:00
Ali Khokhar 92488456bc Refactor messaging platform bridge (#858)
## Summary
- Extract shared messaging platform outbox for queued send/edit/delete,
dedup keys, limiter delegation, and fire-and-forget behavior
- Extract shared voice-note flow for pending voice state, transcription,
cancellation, cleanup, error replies, and IncomingMessage handoff
- Keep Telegram and Discord adapters focused on SDK lifecycle, event
extraction, attachment download, and raw send/edit/delete calls
- Document the split in ARCHITECTURE.md and bump version to 2.3.8

## Verification
- uv run pytest tests/messaging/test_platform_outbox.py
tests/messaging/test_platform_voice_flow.py
tests/messaging/test_voice_handlers.py tests/messaging/test_telegram.py
tests/messaging/test_telegram_edge_cases.py
tests/messaging/test_discord_platform.py
tests/contracts/test_import_boundaries.py
tests/contracts/test_architecture_contracts.py
- .\\scripts\\ci.ps1
2026-06-18 14:26:48 -07:00
Ali Khokhar a97bf7f8b3 Refactor messaging workflow architecture (#852) 2026-06-18 13:10:02 -07:00
Ali Khokhar b2af3f63d2 Refactor API request pipeline (#851) 2026-06-18 02:54:50 -07:00
Alishahryar1 2a68a69d4c Clarify customer-facing architecture contract 2026-06-18 00:10:08 -07:00
Alishahryar1 c024bf6892 Fix stream cleanup context handling.
Avoid contextvar-based log context in SSE generators and treat GeneratorExit as quiet teardown.
2026-06-17 20:43:38 -07:00
Alishahryar1 da672af337 Skip passive tool_search in Responses conversion.
Codex includes OpenAI tool_search in the tools array; omit it from the Anthropic payload like other passive hosted tools so fcc-codex requests do not fail at conversion.
2026-06-17 20:27:11 -07:00
Ali Khokhar 8d2e5b95f7 Refactor OpenAI Responses into modular adapter facade (#847)
## Summary

- Split monolithic `core/openai_responses/conversion.py` and `sse.py`
into focused protocol modules (input, output, stream, tools, reasoning,
events, etc.) behind an `OpenAIResponsesAdapter` facade.
- Wire `ClaudeProxyService.create_response()` through the adapter
instead of importing conversion helpers directly, tightening the
API/import boundary.
- Add Codex bridging for Responses `custom_tool_call` items and document
the adapter architecture in `ARCHITECTURE.md`.

## Test plan

- [x] `uv run pytest tests/core/openai_responses/
tests/api/test_openai_responses.py tests/cli/test_adapters.py
tests/contracts/test_import_boundaries.py`
- [x] Full CI via `.\scripts\ci.ps1`
2026-06-17 20:19:51 -07:00
Ali Khokhar fa01c2a3a6 Refactor provider transports into packages (#845)
## Summary
- move provider transport families under `providers/transports/`
- split OpenAI-chat transport into thin transport, stream runner,
tool-call assembly, and recovery modules
- split native Anthropic transport into thin transport, stream runner,
recovery, and HTTP helper modules
- update concrete provider imports, architecture docs, transport import
contracts, version, and lockfile

## Verification
- `uv run pytest tests/providers/test_streaming_errors.py
tests/providers/test_openai_compat_5xx_retry.py
tests/providers/test_anthropic_messages.py
tests/providers/test_anthropic_messages_429_retry.py
tests/providers/test_provider_transport_logging.py
tests/providers/test_gemini.py
tests/providers/test_nvidia_nim_request.py
tests/providers/test_subagent_interception.py
tests/contracts/test_import_boundaries.py`
- `uv run ruff format`
- `./scripts/ci.ps1`
2026-06-17 15:56:19 -07:00
Alishahryar1 492860cc3d Fix Claude launcher no-auth login gate 2026-06-17 13:10:39 -07:00
Ali Khokhar c51a15608d Add FCC uninstall scripts (#836) 2026-06-17 01:43:28 -07:00
Ali Khokhar e2fa4b66d9 Extract shared stream recovery session for provider transports (#835)
## Summary

- Add `StreamRecoverySession` in
`core/anthropic/stream_recovery_session.py` to centralize early-retry
classification, holdback buffering, retry counting, and flush/discard
behavior shared by Anthropic and OpenAI transports.
- Refactor `AnthropicMessagesTransport` and `OpenAIChatTransport` to use
the shared session instead of duplicating recovery holdback and
early-retry logic.
- Update architecture docs and tests for per-delta overlap trim on
midstream recovery; bump version to 2.2.1.

## Test plan

- [x] `uv run pytest tests/core/anthropic/test_stream_recovery.py`
- [x] `uv run pytest tests/providers/test_anthropic_messages.py
tests/providers/test_streaming_errors.py`
2026-06-16 22:01:53 -07:00
Alishahryar1 7b45043971 Add Codex model picker screenshot 2026-06-16 18:53:13 -07:00
Alishahryar1 fe9d287c23 Add Codex model picker catalog 2026-06-16 18:47:41 -07:00
Alishahryar1 a437df598e Fix Codex responses reasoning bridge 2026-06-16 18:05:15 -07:00
Alishahryar1 3640eaa244 Updated README 2026-06-16 17:37:48 -07:00
Alishahryar1 44fcc09c02 Add architecture map and provider guardrails 2026-06-16 17:33:46 -07:00
Alishahryar1 35c986d164 Update README again 2026-06-16 17:09:49 -07:00
Alishahryar1 b26957faaf Update README 2026-06-16 17:01:24 -07:00
Alishahryar1 dcc4b50aae Fix Codex namespace Responses tools 2026-06-16 16:49:59 -07:00
Ali Khokhar 3abe41d270 Add Codex support (#691) 2026-06-16 16:32:43 -07:00
dependabot[bot] 2b70e26890 build(deps): bump actions/checkout from 6.0.2 to 6.0.3 (#720) 2026-06-05 14:58:01 -07:00
dependabot[bot] 765664500b build(deps): bump astral-sh/setup-uv from 8.1.0 to 8.2.0 (#721) 2026-06-05 14:57:42 -07:00
dependabot[bot] d9c63d8ee6 build(deps): bump the minor-and-patch group with 8 updates (#722) 2026-06-05 14:57:07 -07:00
Ali Khokhar e1de39b39f Update README.md 2026-06-05 08:32:39 -07:00
Alishahryar1 c1af215ff7 fix: normalize proxy auth token whitespace 2026-06-03 23:48:29 -07:00
Alishahryar1 e79b430cc2 Raise stream and upstream retry attempts to five total.
Align early transparent, mid-stream recovery, and 429/5xx execute_with_retry
to five attempts; bump version to 1.2.40.
2026-06-02 22:26:07 -07:00
Alishahryar1 544008a952 Removed stale ignore 2026-06-02 16:17:56 -07:00
Alishahryar1 103869f62f Ignore removed thinking env keys 2026-06-02 05:20:15 -07:00
Alishahryar1 1b259596b2 Update AGENTS.md 2026-06-01 23:03:17 -07:00
Alishahryar1 3bea725343 Update README 2026-06-01 22:57:04 -07:00
Alishahryar1 0fb4c7d6ed fix: remove duplicate api/admin_static wheel force-include
The api package already ships admin_static assets; the extra force-include entry caused hatchling to fail wheel builds with duplicate archive paths.
2026-06-01 22:54:55 -07:00
Alishahryar1 b867e08084 Improve smoke provider coverage and skips 2026-06-01 22:53:34 -07:00
dependabot[bot] 3f65089848 build(deps): update fastapi[standard] requirement from >=0.136.1 to >=0.136.3 (#630) 2026-06-01 21:52:11 -07:00
Ali Khokhar 0a13262a0d Update pyproject.toml 2026-06-01 21:51:25 -07:00