Commit Graph

21 Commits

Author SHA1 Message Date
huangzhenpc
89f731cb19 feat: first-byte timeout with same-endpoint retry
Some checks failed
Build Docker Image / build (push) Has been cancelled
Upstream sometimes accepts a request (HTTP 200 headers) but stalls without
sending any event-stream packet. Add a configurable timeout that counts
from request dispatch until the first AWS event-stream prelude is read,
and retry on the same endpoint before falling back.

- Config: FirstByteTimeoutSec (default 10s, 0=disabled, range 0-300),
  FirstByteRetries (default 1, range 0-10), with Get/Update helpers.
- kiro.go: parseEventStream signature gains onFirstByte callback, fired
  once when the first 12-byte prelude reads successfully. CallKiroAPI
  wraps each attempt in a context.WithCancel + time.AfterFunc timer that
  cancels the HTTP request if no event arrives before the deadline.
  Separate retry budgets for INVALID_MODEL_ID and first-byte timeout,
  tracked on the same attempt loop; maxAttempts = max(both)+1.
- handler.go: /admin/api/general extended to read/write the two new
  fields with validation (timeout 0-300, retries 0-10).
- web/index.html: General Settings card gains two numeric inputs plus
  CN/EN i18n and the corresponding load/save JS.
2026-05-12 09:04:11 +08:00
huangzhenpc
de4524ad19 Merge upstream Quorinex/Kiro-Go v1.0.6 with local features preserved
Some checks failed
Build Docker Image / build (push) Has been cancelled
Brought in 9 upstream commits:
- 221348b thinking routing: ClaudeRequest.Thinking + Signature + includeEmptyThinkingBlock
- 0203357 + 31aa6aa accurate input_tokens via contextUsageEvent
- 404e242 + 50f1a7e outbound proxy (socks5/http) + UI
- 940dc78 version bump to 1.0.6
- 3 CI workflow changes

Strategy: took upstream base for the 4 conflicting files, then re-applied
our local changes on top:
- config.go: InvalidModelRetries field + GetInvalidModelRetries/UpdateInvalidModelRetries
- kiro.go: AmazonQ origin CLI->AI_EDITOR, attempt-level retry loop for
  INVALID_MODEL_ID, detailed log.Printf (account/model/attempt/elapsed),
  log import; adopted upstream's kiroHttpStore atomic pointer for Do()
- handler.go: /admin/api/general GET/POST + apiGetGeneralConfig +
  apiUpdateGeneralConfig
- web/index.html: General Settings card (invalid-model-retries),
  CN/EN i18n, loadGeneralConfig/saveGeneralConfig, call from initSettings

Build + full test suite green on Go 1.24.3.
2026-05-12 00:09:33 +08:00
Quorinex
940dc782cb chore: bump version to 1.0.6 2026-05-11 22:31:31 +08:00
Quorinex
50f1a7e5ad refactor: improve proxy settings UI with type selector and structured fields 2026-05-11 22:31:30 +08:00
Quorinex
404e2425fa feat: add outbound proxy support (socks5/http) for restricted networks 2026-05-11 22:31:30 +08:00
huangzhenpc
3b791a6926 feat: add INVALID_MODEL_ID retry config + detailed request logging
- Config: new InvalidModelRetries field (default 3, range 0-20)
- Admin API: /admin/api/general GET/POST for general settings
- Admin UI: new "通用设置" card with retry count input
- CallKiroAPI: same-endpoint retry on HTTP 400 INVALID_MODEL_ID
  before falling back to next endpoint
- CallKiroAPI: switched to log.Printf with timestamp, account,
  model, attempt counter, elapsed time, error body truncation
2026-05-11 19:15:49 +08:00
hkxiaoyao
ad7aabd554 feat: Add validation and account management functionality (#21)
* feat: Add validation and account management functionality

- Add validation for clientID and clientSecret in refreshOIDCToken function
- Add weight field for load balancing priority in Account struct
- Implement weighted轮询策略以根据账号权重分配选择概率。
- Add batch account management functionality including enabling, disabling, refreshing, and retrieving account details.
- Update Kiro API version and adjust user agent strings to reflect new version numbers.
- Update Kiro version and modify user agent strings and header settings.
- Refactor model mapping to an ordered list for precise key matching.
- Add account bulk actions and filtering toolbar to index.html

* feat: Add logic to skip accounts with exhausted usage limits

- Add logic to skip accounts with exhausted usage limits when selecting the next account.
2026-02-23 21:47:17 +08:00
hkxiaoyao
84998a0672 feat: Extract and export client credentials securely (#17)
- Extract and export client credentials and access tokens securely.
2026-02-19 20:07:27 +08:00
hkxiaoyao
f080fe3d54 feat: Add endpoints for account details and error handling (#16)
* feat: Add JSON copy functionality with success animation

- Add functionality to copy account data as JSON and show success animation.

* feat: Add endpoints for account details and error handling

- Add endpoint to retrieve full account details including sensitive information
- Add error handling for fetching and copying full account JSON data
2026-02-13 16:59:03 +08:00
hkxiaoyao
1afc82c29c feat: Add account ban handling and UI updates (#11)
- Add ban status and reason fields to account configuration
- Add account ban status and details handling in API refresh account function.
- Add logic to handle account suspension and authentication errors, updating ban status accordingly.
- Add and style badge classes for different account statuses and modify account status display logic.
2026-02-10 12:23:39 +08:00
Quorinex
a308630156 feat: add admin logout, 72h session expiry, /v1/stats endpoint, and UI fixes 2026-02-08 19:23:00 +08:00
hkxiaoyao
99ce5c9c39 feat: Add privacy mode toggle and update email masking (#6)
- Add privacy mode toggle switch and update email masking logic.
2026-02-08 18:21:58 +08:00
Quorinex
3e7cca04ba feat: add versioning, account export, and dynamic models list 2026-02-08 01:48:24 +08:00
hkxiaoyao
9aad3dec7e refactor: Refactor authentication method based on presence of client credentials (#5)
- Refactor authentication method based on presence of client credentials in payload.
2026-02-08 00:02:35 +08:00
hkxiaoyao
5332a5381e Optimize loading model display, add credit (#4) 2026-02-07 21:17:21 +08:00
Quorinex
d6fa49f24e feat: add i18n support and batch JSON credentials import 2026-02-06 21:54:04 +08:00
hkxiaoyao
d05bd00207 Merge pull request #3 from hkxiaoyao/main
feat(account): add trial quota tracking and display
2026-02-06 13:16:24 +08:00
Quorinex
01e9d0577c feat: add thinking mode support with configurable output formats 2026-02-04 17:42:30 +08:00
Quorinex
4f3be1258e feat: add AWS Builder ID login and local Kiro cache import 2026-02-04 05:09:42 +08:00
Quorinex
b27fd3528a fix: center login title and use full time unit names 2026-02-04 02:06:28 +08:00
Quorinex
c5e6d42163 feat: Kiro API Proxy - OpenAI/Anthropic compatible API service
- Multi-account pool with round-robin load balancing
- Auto token refresh for IAM IdC and Social auth
- Streaming support (SSE)
- Web admin panel with account management
- Docker support with GitHub Actions CI/CD
- Machine ID management per account
- Usage tracking (requests, tokens, credits)
2026-02-04 00:37:05 +08:00