Skip to content

[pull] main from Alishahryar1:main - #255

Merged
pull[bot] merged 5 commits into
Co-Contribute-OpenSource:mainfrom
Alishahryar1:main
Sep 29, 2026
Merged

pull[bot] merged 5 commits into
Co-Contribute-OpenSource:mainfrom
Alishahryar1:main

Conversation

@pull

@pull pull Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

## Why

Alibaba Cloud Model Studio pay-as-you-go keys need their own provider
configuration and model discovery. The existing QwenCloud Token Plan and
Coding Plan entries use subscription-specific endpoints.

## How

- Add an Alibaba Cloud provider card with API key, base URL, and proxy
settings. Default to Singapore and allow regional or workspace endpoints
with a matching regional key.
- Reuse FCC's OpenAI Chat Completions transport for Anthropic Messages
and OpenAI Responses clients, including streaming, function calls, and
thinking output.
- Discover tool-capable inference models through the paginated DashScope
`/api/v1/models` endpoint. Require advertised chat-compatible
capabilities and exclude Realtime models before publishing model IDs.
Read model context limits, output limits, and input modalities.
- Validate model IDs across every page, including excluded models.
Reject duplicate IDs and inconsistent catalogs so pagination cannot
silently publish a partial model list.
- Leave thinking computation at the model's upstream defaults. Thinking
on/off, effort, and budget controls are not translated in this
integration.
- Document setup and add the provider to the existing smoke
configuration.





<!-- greptile_comment -->

<!-- greptile_summary -->

<h2><a
href="https://app.greptile.com/api/retrigger?id=71089453"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img
alt="Retrigger"
src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"
align="right"></picture></a>Confidence Score: 5/5</h2>

<!-- greptile-risk -->

No outstanding findings block merging.

<details open><summary>Summary</summary>

The PR adds an Alibaba Cloud provider with model discovery and chat
transport. Subsequent changes filter the model catalog by capability and
reject duplicate model IDs. No outstanding findings remain.
</details>

<!-- greptile_confidence_score:5 -->

<sub>Reviews (2) · Last reviewed commit: ["Fix Alibaba model
compatibility and
pagi..."](https://github.com/alishahryar1/free-claude-code/commit/fcc8d505e7aead346d8033fe1d66fe79da1f1afa)</sub>

<!-- /greptile_comment -->
## Why

Code and messaging open and close a SQLite connection for every
transaction. Repeated connection setup and WAL cleanup add storage
latency, especially when concurrent writes contend.

Three alternating local benchmark rounds at `684884e5` against
`7c5d5468`, using eight concurrent callers and WAL/FULL durability,
measured these median results:

| Workload | Before | After | Throughput improvement |
| --- | ---: | ---: | ---: |
| Mixed SQL reads/writes | 764 ops/s | 6,608 ops/s | 8.65x |
| Code create/read/delete/check cycle | 114 cycles/s | 735 cycles/s |
6.47x |
| Messaging tree/message persistence and history restoration | 104
cycles/s | 706 cycles/s | 6.79x |

Code-cycle p99 fell from 565 ms to 12 ms; messaging-cycle p99 fell from
569 ms to 15 ms. All 18 trials passed data and integrity checks. These
are local storage measurements, not whole-app speedups or proof of the
earlier Windows CI timeout's cause.

## How

- Let the application-owned `SQLiteDatabase` reuse one writer and four
reader connections through standalone SQLAlchemy QueuePool. Match async
admission to those capacities so waiting writes leave AnyIO workers
available for reads and other work.
- Keep each lease inside one synchronous worker. Route legacy import's
sequential transactions through its single writer admission slot.
- Explicitly roll back failed SQL transactions and discard their
connections even when rollback succeeds. A failed callback's traceback
can retain a SELECT cursor and its old snapshot, so the next borrower
must receive a fresh connection. Successful transactions reuse their
connections.
- Drain accepted queued/running work, dispose both pools, then release
process ownership. Preserve committed-result delivery through caller
cancellation and clean up partial startup. Accepted calls retain the
existing wait-until-complete behavior.
- Cover reuse, cross-thread leases, capacity, reader progress,
cancellation, failed transactions, retained-cursor isolation after
history decoding fails, import rollback, startup and disposal with
deterministic tests. Add the base SQLAlchemy dependency and lock it to
2.1.1.

Full local `scripts/ci.ps1` validation passed, including formatting,
lint, typing, Python tests and Playwright. Benchmark scripts and raw
databases remain in the local untracked investigation folder.




<!-- greptile_comment -->

<!-- greptile_summary -->

<h2><a
href="https://app.greptile.com/api/retrigger?id=71137019"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img
alt="Retrigger"
src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"
align="right"></picture></a>Confidence Score: 5/5</h2>

<!-- greptile-risk -->

No identified finding blocks merging.

<details open><summary>Summary</summary>

The PR pools SQLite connections for Code and messaging. The latest
commit discards connections after failed transactions and adds
regression coverage for retained read cursors and import rollback. No
new actionable issue was identified.
</details>

<!-- greptile_confidence_score:5 -->

<sub>Reviews (2) · Last reviewed commit: ["Discard SQLite connections
after failed
..."](https://github.com/alishahryar1/free-claude-code/commit/234b24714a52b68e942ed79f9ac3bf53e7d59a36)</sub>

<!-- /greptile_comment -->
## Why

Server startup emptied the log before opening its append-mode sink,
erasing the previous run's unrotated diagnostics.

## How

Open the existing log in append mode during initial setup and forced
reconfiguration. Keep the `LOG_FILE` override, which smoke tests use to
collect diagnostics, with `~/.fcc/logs/server.log` as the default.

Regression tests verify that records survive separate process launches
and forced logging reconfiguration.


<!-- greptile_comment -->

<!-- greptile_summary -->

<h2><a
href="https://app.greptile.com/api/retrigger?id=71158867"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img
alt="Retrigger"
src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"
align="right"></picture></a>Confidence Score: 5/5</h2>

<!-- greptile-risk -->

Safe to merge based on the logging behavior checked.

What we checked:
- Ran two-process logging restart reproduction scripts before and after
applying the PR, and confirmed that the PR version preserves the first
run and appends the second run, whereas the pre-PR version retains only
the second run. <a href="https://www.greptile.com/trex"><img alt="T-Rex"
src="https://greptile-static-assets.s3.amazonaws.com/trex/trex_green.svg"
height="16" align="absmiddle"></a>
- Executed forced-reconfiguration reproduction scripts for base and
head; observed that the pre-PR run lost 1,001 records while the PR run
retained all 2,001 records; focused logging regression tests also
passed. <a href="https://www.greptile.com/trex"><img alt="T-Rex"
src="https://greptile-static-assets.s3.amazonaws.com/trex/trex_green.svg"
height="16" align="absmiddle"></a>
- Reviewed the logging configuration changes, noting that the truncating
write was removed and the file sink now uses append mode, which explains
why the PR run includes both first and second runs. <a
href="https://www.greptile.com/trex"><img alt="T-Rex"
src="https://greptile-static-assets.s3.amazonaws.com/trex/trex_green.svg"
height="16" align="absmiddle"></a>
- Validated that the 2,001-record scenario with PR #1940 completes
without missing records, confirming full retention under the changed
code. <a href="https://www.greptile.com/trex"><img alt="T-Rex"
src="https://greptile-static-assets.s3.amazonaws.com/trex/trex_green.svg"
height="16" align="absmiddle"></a>

<details open><summary>Summary</summary>

The PR stops clearing the server log during initial setup and forced
reconfiguration, preserving records across runs. It adds regression
tests for both cases. No merge-blocking issue was found.
</details>

<!-- greptile_confidence_score:5 -->

<sub>Reviews (1) · Last reviewed commit: ["Keep LOG\_FILE override and
existing
smok..."](https://github.com/alishahryar1/free-claude-code/commit/997f472662a6d9d51384f0b6dfc5985c5aae554c)</sub>

<!-- /greptile_comment -->
## Why

FCC's custom JSON formatter dropped exception details and bound fields
outside its fixed allowlist. An intercepted exception could be written
as only "request failed", losing the information needed to diagnose it.

## How

Use Loguru's built-in JSON serialization (`serialize=True`) and delete
the custom formatter and its redaction functions. New JSON lines contain
Loguru's `text` and `record` fields, including rendered tracebacks,
exception metadata and bound/contextual fields. The sink preserves
supplied message text without an additional redaction hook, as agreed
for these local diagnostic logs.

Update trace readers and smoke assertions to read
`record.extra.trace_payload` and log readers to handle Loguru's UTF-8
output.




<!-- greptile_comment -->

<!-- greptile_summary -->

<h2><a
href="https://app.greptile.com/api/retrigger?id=71172606"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img
alt="Retrigger"
src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"
align="right"></picture></a>Confidence Score: 5/5</h2>

<!-- greptile-risk -->

No outstanding findings block merging.

<details open><summary>Summary</summary>

The PR updates serialized trace logging and its readers. The smoke trace
parser test now uses fixed output instead of reconfiguring process-wide
logging.
</details>

<!-- greptile_confidence_score:5 -->

<sub>Reviews (2) · Last reviewed commit: ["Isolate smoke trace parser
test from
glo..."](https://github.com/alishahryar1/free-claude-code/commit/3fb4fd6484775b4fb83d58f5fc9616754717810e)</sub>

<!-- /greptile_comment -->
## Why

Uvicorn's console handlers stop server errors, access logs and the Admin
UI startup message from reaching FCC's log file. Desktop startup can
also inherit console handlers from an earlier Uvicorn configuration.

The restart browser test can reply to already-aborted status requests on
slow runners, leaving the UI waiting indefinitely for the mocked new
server.

## How

Attach FCC's existing Loguru interceptor to Uvicorn's server and access
loggers. Preserve Uvicorn's console handlers for CLI startup. Remove
console handler and formatter definitions for desktop startup, allowing
Windows GUI launch with no stdout or stderr. Copy Uvicorn's
configuration so its global defaults remain unchanged.

The file receives each record once, preserves exception tracebacks and
respects the configured file log level across server restarts.

Make the restart browser mock answer every status request immediately
with the current simulated server state. Wait for the matching response
before checking each intermediate state, preserving coverage without
holding requests past their timeout.
@pull pull Bot locked and limited conversation to collaborators Sep 29, 2026
@pull pull Bot added the ⤵️ pull label Sep 29, 2026
@pull
pull Bot merged commit 9e23905 into Co-Contribute-OpenSource:main Sep 29, 2026
10 of 11 checks passed

This branch had an error being deployed

1 failed deployment
pypi — 9e239055 Deployed Sep 29, 2026 by pull[bot] via Publish to PyPI #12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant