Use Claude Code, Codex, VSCode, Pi, and OpenCode (and 6 other harnesses) for free (1.3B+ free tokens) from your terminal, app, IDE, or phone, and now from the browser with native browser sessions (multi-harness + multi-model) like OpenClaw (voice supported + ToS friendly)
Python
Fix Grok response timestamps and README provider count (#1672)
Ali Khokharcd6425eee439
diff --git a/README.md b/README.mdindex 418f76e5..8185e785 100644--- a/README.md+++ b/README.md@@ -25,7 +25,7 @@## What You Get-- **49 ToS-friendly providers. 1.3B+ free tokens every month.** Use free, paid, subscription, and local models from one searchable UI without putting your account at risk. FCC follows provider terms and removes integrations if they stop being allowed.+- **50 ToS-friendly providers. 1.3B+ free tokens every month.** Use free, paid, subscription, and local models from one searchable UI without putting your account at risk. FCC follows provider terms and removes integrations if they stop being allowed.- **10 coding agents. One model catalog.** Run [Claude Code](https://code.claude.com/docs/en/overview), [Codex](https://github.com/openai/codex), [Pi](https://github.com/earendil-works/pi), [OpenCode](https://github.com/anomalyco/opencode), [Cline](https://github.com/cline/cline), [Hermes](https://github.com/NousResearch/hermes-agent), [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness), [Grok Build](https://github.com/xai-org/grok-build), [Muse Code](https://research.meta.ai/blog/introducing-muse-code-and-muse-spark-1-2/), or [Aider](https://aider.chat/) with your FCC models.- **Keep coding through provider outages.** After retries are exhausted, FCC automatically tries your next configured model without making you restart the turn—across every client.- **Up to 90% fewer terminal-output tokens.** Optional [RTK](https://github.com/rtk-ai/rtk) filters common command output, while five FCC optimizations handle quota probes, command-prefix detection, titles, suggestions, and filepaths without calling a provider.diff --git a/pyproject.toml b/pyproject.tomlindex 3936bcb2..32b6447e 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "hatchling.build"[project]name = "free-claude-code"-version = "5.22.1"+version = "5.22.2"description = "Local proxy connecting coding agents to OpenAI-compatible AI providers"readme = "README.md"requires-python = ">=3.14.0"diff --git a/src/free_claude_code/core/openai_responses/native.py b/src/free_claude_code/core/openai_responses/native.pyindex 917c8bc0..16716c02 100644--- a/src/free_claude_code/core/openai_responses/native.py+++ b/src/free_claude_code/core/openai_responses/native.py@@ -68,7 +68,7 @@ class NativeResponsesRelay:return self._terminal_type is not Nonedef feed(self, event_type: str, payload: Mapping[str, object]) -> str:- """Format one upstream event after rewriting FCC-owned model metadata."""+ """Format public model metadata and canonical whole-second timestamps."""if self._terminal_type is not None:raise ValueError(@@ -79,6 +79,12 @@ class NativeResponsesRelay:response = data.get("response")if isinstance(response, dict):response["model"] = self._public_model+ # SDK models coerce integer timestamps to floats; strict clients+ # require JSON integers. Preserve any actual fractional precision.+ for field in ("created_at", "completed_at"):+ timestamp = response.get(field)+ if isinstance(timestamp, float) and timestamp.is_integer():+ response[field] = int(timestamp)self._response = cast(JsonObject, deepcopy(response))response_id = response.get("id")if isinstance(response_id, str) and response_id:diff --git a/tests/core/openai_responses/test_native.py b/tests/core/openai_responses/test_native.pyindex 1b670d0f..d7666b29 100644--- a/tests/core/openai_responses/test_native.py+++ b/tests/core/openai_responses/test_native.py@@ -231,6 +231,45 @@ def test_native_relay_preserves_payload_and_rewrites_only_response_model() -> Noassert relay.terminal_type == "response.completed"+ ("timestamp", "expected_type"),+ [+ (1788587503.0, int),+ (1788587503, int),+ (1788587503.25, float),+ (None, type(None)),+ ],+)[email protected]("event_type", ["response.created", "response.failed"])+def test_native_relay_serializes_whole_second_timestamps_as_integers(+ timestamp: float | int | None, expected_type: type, event_type: str+) -> None:+ relay = NativeResponsesRelay(public_model="gateway-model")+ original = {+ "type": event_type,+ "response": {+ "id": "resp_upstream",+ "created_at": timestamp,+ "completed_at": timestamp,+ "temperature": 1.0,+ "metadata": {"created_at": 1788587503.0},+ },+ }++ _, payload = _event_payload(relay.feed(event_type, original))++ response = payload["response"]+ assert isinstance(response, dict)+ for key in ("created_at", "completed_at"):+ assert type(response[key]) is expected_type+ assert response[key] == timestamp+ assert type(original["response"][key]) is type(timestamp)+ assert type(response["temperature"]) is float+ metadata = response["metadata"]+ assert isinstance(metadata, dict)+ assert type(metadata["created_at"]) is float++def test_native_relay_rejects_events_after_one_terminal() -> None:relay = NativeResponsesRelay(public_model="gateway-model")relay.feed(diff --git a/tests/providers/test_openai_responses_transport.py b/tests/providers/test_openai_responses_transport.pyindex 6f31cac7..e68f4cf2 100644--- a/tests/providers/test_openai_responses_transport.py+++ b/tests/providers/test_openai_responses_transport.py@@ -169,6 +169,7 @@ async def test_native_responses_preserves_request_and_upstream_event_identity()captured: list[dict[str, object]] = []created_response = {**_completed_response(model="upstream-model"),+ "created_at": 1788587503,"status": "in_progress","output": [],"usage": None,@@ -179,7 +180,14 @@ async def test_native_responses_preserves_request_and_upstream_event_identity()"response": created_response,}delta = _text_delta("hello", sequence=1)- completed = _completed_event(sequence=2)+ completed = {+ **_completed_event(sequence=2),+ "response": {+ **_completed_response(),+ "created_at": 1788587503,+ "completed_at": 1788587504,+ },+ }def handler(request: httpx2.Request) -> httpx2.Response:payload = json.loads(request.content)@@ -224,8 +232,14 @@ async def test_native_responses_preserves_request_and_upstream_event_identity()]assert events[0].data["response"]["id"] == "resp_test"assert events[0].data["response"]["model"] == "public-model"+ for event in (events[0], events[2]):+ timestamp = event.data["response"]["created_at"]+ assert type(timestamp) is int+ assert timestamp == 1788587503assert events[1].data == deltaassert events[2].data["response"]["model"] == "public-model"+ assert type(events[2].data["response"]["completed_at"]) is int+ assert events[2].data["response"]["completed_at"] == 1788587504@pytest.mark.asynciodiff --git a/uv.lock b/uv.lockindex 8e871bcb..420d369e 100644--- a/uv.lock+++ b/uv.lock@@ -598,7 +598,7 @@ wheels = [[[package]]name = "free-claude-code"-version = "5.22.1"+version = "5.22.2"source = { editable = "." }dependencies = [{ name = "aiohttp" },