Commit Graph

679 Commits

Author SHA1 Message Date
boos 5bd847dd06 docs: complete Docker deployment documentation
- Fix all remaining metapi → boosapi references
- Full docker-compose.yml example with healthcheck
- .env file pattern with variable interpolation
- Complete environment variable reference table
- Docker Compose production checklist
- Redis/MySQL/PostgreSQL extension configs
- Resource limits example
- Nginx WebSocket support
- Admin panel IP restriction pattern
- Upgrade/rollback procedures with commands

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-16 00:54:54 +08:00
boos 0106dd3f5d Full internal rename: metapi → boosapi
Rename all remaining internal protocol identifiers:
- x-metapi-* headers → x-boosapi-*
- metapi: reasoning prefix → boosapi:
- __metapi* runtime markers → __boosapi*
- file-metapi-* → file-boosapi-*
- METAPI_* env vars → BOOSAPI_*
- metapi_turn_state/metapi_mcp_item__ etc. → boosapi_*
- package.json name → boosapi
- Docker/deploy/k3s/docs references

46 files changed, 168 insertions, 170 deletions.
typecheck:web passes (0 new errors).

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-16 00:46:28 +08:00
boos d2c16c3919 docs: add plan/ directory with 2026-05-15 dev report
- ComfyUI Agent conversational interface (SSE streaming)
- Metapi → BoosAPI full rebranding
- Gitea CI/CD runner on Alpine (OpenRC)
- Notification service architecture doc

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-16 00:37:38 +08:00
boos 0f3ff82147 fix: restore ComfyUI as workflow frontend with BoosAPI backend integration
ComfyUI is kept as a visual workflow editor (node-based). All actual
generation goes through BoosAPI's own API via boosapi_comfy_nodes.py
custom nodes (now defaulting to localhost:4000/v1).

Architecture:
  BoosAPI (Node.js, port 4000)
    ├── /video-agent → iframe → ComfyUI (Python, port 8188, CPU)
    │                              └── custom_nodes/boosapi_comfy_nodes.py
    │                                   └── calls BoosAPI /v1/... API
    ├── /comfyui-agent → chat interface (direct API calls)
    └── /v1/... → API endpoints (LLM, image, TTS, video)

Signed-off-by: boos <boos@boos.lat>
2026-05-16 00:26:07 +08:00
boos bd06698c8e refactor: fully embed ComfyUI into BoosAPI, drop external dependency
- Remove comfyui.ts (external proxy to ComfyUI at :8188)
- Remove videoAgent.ts (redundant with comfyuiAgent)
- Remove ComfyUI Python process from Dockerfile (CPU-only, useless)
- Update boosapi_comfy_nodes.py default to localhost BoosAPI
- Clean up index.ts, App.tsx, desktop.ts registrations
- Sidebar: merge '视频工作台'/'视频助手' into single '视频助手' entry

Signed-off-by: boos <boos@boos.lat>
2026-05-16 00:21:18 +08:00
boos 9612bfcb3b chore: remove .github folder
Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-16 00:17:00 +08:00
boos 48eb5bddf9 chore: remove CI entirely
Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-16 00:15:23 +08:00
boos f92d0352a0 fix: lighter CI - single job, skip heavy builds, limit node memory
Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-16 00:05:15 +08:00
boos 2f9f3614a2 fix: adapt CI for Gitea Actions, remove Docker/GitHub-specific workflows
- Rewrite ci.yml: replace GitHub Actions with run: steps, drop
  Docker publish, MySQL/Postgres schema, and artifact upload jobs
- Delete codeql.yml (GitHub CodeQL, not available on Gitea)
- Delete docs-pages.yml (GitHub Pages specific)
- Delete release.yml (Docker Hub + GitHub Releases)
- Delete claude-code.md, claude-opus-4.7.md (unused)

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-15 22:54:30 +08:00
boos cd42de2689 docs: add SaaS multi-tenant features and REST API overview
- Add SaaS multi-tenant section to both Chinese and English READMEs
- Add REST API endpoint reference table
- Add SaaS/plan highlights in subtitle and pain-point table
- Bilingual sync

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-15 22:35:16 +08:00
boos 7886a0ab8b feat: add SaaS multi-tenant user management
- Add organizations, organization_members, invitations, data_plans tables
- Add organizationService (CRUD, member management, plan limit check)
- Add invitationService (create, accept, cancel invitations)
- Add planService (plan limits, seed defaults)
- Add /api/organizations/* routes (org CRUD, members, invitations)
- Add /api/invitations/* routes (public invite lookup, accept)
- Seed default plans (free/pro/enterprise) on startup

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-15 21:25:53 +08:00
boos 07013e2a39 docs: highlight built-in ComfyUI features
- Add ComfyUI chat assistant description in subtitle
- Add ComfyUI section in core features
- Update both Chinese and English versions

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-15 20:58:29 +08:00
boos 2c4aabe961 docs: rewrite README for BoosAPI rebranding
- Replace all Metapi references with BoosAPI
- Remove external service links (GitHub, Docker Hub, Render, Zeabur)
- Simplify structure for self-hosted deployment
- Update both Chinese and English versions

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-15 20:51:10 +08:00
boos 9cfe8427b5 feat: rebrand Metapi to BoosAPI, add ComfyUI agent and user management
- Rename project from Metapi to BoosAPI across all UI and server strings
- Add ComfyUI conversational agent page (/comfyui-agent)
- Add user management system (register, login, API keys, admin)
- Update Dockerfile and database schema
- Add ComfyUI workflow nodes support
- Update shared contracts and platform configurations

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-15 20:20:58 +08:00
Tursom K. Ulefits cdb12a9819 [codex] fix quota refresh probe model (#490) 2026-05-08 22:55:17 +08:00
Ju Zi f19ddac865 feat: 支持从站点页快捷添加 API Key (#505)
Co-authored-by: juzi <956428403@qq.com>
2026-05-08 22:54:40 +08:00
Cita 90e2f0c405 Merge PR #535: clear production dependency audit
Merge the narrow package-lock refresh that restores the main production audit gate.
2026-05-08 17:39:42 +08:00
cita-777 0f51dec36e Clear the main-branch production audit gate
Constraint: main push CI fails on npm audit --omit=dev --audit-level=high after recent merges.
Rejected: Broad npm audit fix output | it updated unrelated dev-only lockfile entries.
Confidence: high
Scope-risk: narrow
Directive: Keep PR audit informational until production dependencies are audited on dev/main consistently.
Tested: ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm ci --prefer-offline --no-audit --no-fund; npm audit --omit=dev --audit-level=high; npm run typecheck:server; npm test -- --run src/server/config.test.ts src/server/settingsRoutePayloads.test.ts
Not-tested: Full GitHub Actions matrix before opening PR.
2026-05-08 17:35:24 +08:00
Cita f4148675e1 Merge PR #510: per-site model probe
Merged after updating the PR onto current main and fixing the remaining probe-setting review gaps.\n\nValidation:\n- GitHub checks all passing: Test Core, Typecheck, Build Web/Server/Desktop, Repo Drift Check, Schema SQLite/MySQL/Postgres, CodeQL, CodeRabbit.\n- Local: npm run typecheck\n- Local: npm run repo:drift-check\n- Local: npx vitest run --root . src/server/db/schemaContract.test.ts src/server/db/schemaArtifactGenerator.test.ts src/server/db/schemaIntrospection.test.ts src/server/db/schemaParity.test.ts src/web/api.test.ts src/web/pages/helpers/sitesEditor.test.ts src/web/pages/sites.disabled-models-save.test.tsx src/web/pages/sites.edit-scroll.test.tsx
2026-05-08 16:58:27 +08:00
cita-777 e5a8a0b3d7 Keep per-site probe settings reliable before merge
Refresh the PR onto current main and close the remaining probe-setting review gaps: the primary site save now persists the latency threshold, the site row type carries that field without an any-cast, active probe streams are aborted on unmount, and all-model one-shot probes get the longer timeout they need.

Constraint: PR #510 must preserve the per-site model probe feature while merging cleanly into current main.
Rejected: Leave threshold persistence behind the separate probe-settings button | the primary save path would still silently drop user changes.
Rejected: Keep the SiteRow any-cast | it hides API/schema drift for the new persisted field.
Confidence: high
Scope-risk: narrow
Directive: Keep probe setting fields represented in the typed site save payload and covered by focused web API/editor tests.
Tested: npm run typecheck; npm run repo:drift-check; npx vitest run --root . src/server/db/schemaContract.test.ts src/server/db/schemaArtifactGenerator.test.ts src/server/db/schemaIntrospection.test.ts src/server/db/schemaParity.test.ts src/web/api.test.ts src/web/pages/helpers/sitesEditor.test.ts src/web/pages/sites.disabled-models-save.test.tsx src/web/pages/sites.edit-scroll.test.tsx
Not-tested: Full npm test.
2026-05-08 16:51:05 +08:00
Cita 1d61a7ac84 Merge PR #495: auto-discover recent Docker Hub dev tags
Merged after resolving conflicts with current main.\n\nValidation:\n- GitHub checks all passing: Test Core, Typecheck, Build Web/Server/Desktop, Repo Drift Check, Schema checks, CodeQL, CodeRabbit.\n- Local: npx vitest run --root . src/web/pages/settings/UpdateCenterSection.test.tsx src/server/services/updateCenterVersionService.test.ts src/server/routes/api/updateCenter.test.ts src/server/services/updateCenterStatusService.test.ts\n- Local: npm run typecheck\n- Local: npm run repo:drift-check
2026-05-08 16:27:26 +08:00
cita-777 93bc42a69d Refresh the recent Docker tag PR onto current main
The release branch had fallen behind current main and only conflicted in the
Update Center recent-tag test. Keep the latest main-side deploy-state coverage
while preserving the PR's raw-tag filtering and digest visibility assertions.

Constraint: PR #495 must merge into the current main without widening the PR diff beyond the update-center candidate behavior.
Rejected: Drop the PR-specific digest/raw-tag assertions | would regress the review fixes that prompted the branch update.
Confidence: high
Scope-risk: narrow
Directive: Keep recent Docker tag cards deployable only from real tagName values and keep digest metadata visible before deployment.
Tested: npx vitest run --root . src/web/pages/settings/UpdateCenterSection.test.tsx src/server/services/updateCenterVersionService.test.ts src/server/routes/api/updateCenter.test.ts src/server/services/updateCenterStatusService.test.ts; npm run typecheck; npm run repo:drift-check; git diff --cached --check origin/main
Not-tested: Full npm test.
2026-05-08 16:23:05 +08:00
Cita 508fa71ec7 Merge pull request #518 from kevinye13/fix/settings-allowlist-json-array
fix(settings): persist model allowlist as JSON array
2026-05-08 16:05:15 +08:00
Cita 3ce705ab9d Update contributors section in README.md 2026-05-08 15:37:37 +08:00
Cita 4481cf7493 Clean up contributor section in README
Removed unnecessary contributor images from the README.
2026-05-08 15:29:19 +08:00
Cita 3720b3d0ed Merge pull request #533 from cita-777/release/fix-protocol-compatibility-20260508
[fix] Harden protocol compatibility from dev
2026-05-08 11:05:31 +08:00
cita-777 10dc1ba7bd Carry update center review test follow-up
This merge keeps PR #533 aligned with dev after addressing CodeRabbit follow-up test comments. The changes are limited to UpdateCenterSection test assertions.

Constraint: Release branch remains the publication branch for the open main-targeting PR.

Confidence: high

Scope-risk: narrow

Tested: npx vitest run --root . src/web/pages/settings/UpdateCenterSection.test.tsx

Tested: npm run typecheck:web

Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-08 10:50:25 +08:00
cita-777 fee6a6388f Tighten update center review test coverage
CodeRabbit follow-up review pointed out that one renderer assertion could not fail usefully and that the new recent-candidate deploy test did not prove log streaming after dispatch. The test now asserts the visible candidate text directly and covers streamUpdateCenterTaskLogs for the new deploy path.

Constraint: Keep review follow-up scoped to test coverage only.

Confidence: high

Scope-risk: narrow

Tested: npx vitest run --root . src/web/pages/settings/UpdateCenterSection.test.tsx

Tested: npm run typecheck:web

Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-08 10:50:10 +08:00
cita-777 00348e0528 Carry protocol review fixes into release
The release branch is main-based and tracks the reviewed dev slice for PR publication. This merge carries the post-review compatibility fixes without rewriting the already-open PR history.

Constraint: PR #533 publishes dev changes through a clean release branch targeting main.

Rejected: Recreate the PR branch from scratch | unnecessary churn after green checks and review context already exist.

Confidence: high

Scope-risk: narrow

Tested: npx vitest run --root . src/server/proxy-core/responsesPreflight.test.ts src/server/proxy-core/serviceTierPolicy.test.ts src/server/routes/proxy/chat.stream.test.ts src/web/pages/settings/UpdateCenterSection.test.tsx

Tested: npm run typecheck:server

Tested: npm run typecheck:web

Tested: npm run repo:drift-check

Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-08 10:43:12 +08:00
cita-777 8309ac073a Close protocol compatibility review gaps
Review feedback found narrow compatibility regressions in the web-search shim, Responses tool detection, service tier accounting, and update-center Docker candidate actions. The fix keeps synthetic search routed through the dedicated search model, preserves Responses text compatibility, distinguishes absent service_tier from filtered service_tier, and evaluates recent Docker tags per candidate.

Constraint: Review fixes must stay on dev first, then flow into the main-based release PR branch.

Rejected: Leave Responses web_search simulation on the request model | it has the same search-route selection risk as Anthropic simulation.

Confidence: high

Scope-risk: narrow

Tested: npx vitest run --root . src/server/proxy-core/responsesPreflight.test.ts src/server/proxy-core/serviceTierPolicy.test.ts src/server/routes/proxy/chat.stream.test.ts src/web/pages/settings/UpdateCenterSection.test.tsx

Tested: npm run typecheck:server

Tested: npm run typecheck:web

Tested: npm run repo:drift-check

Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-08 10:42:49 +08:00
cita-777 207ab5cedf Prepare protocol compatibility release 2026-05-08 00:32:50 +08:00
cita-777 2491a9af5a Harden cross-protocol request compatibility
Several downstream clients send non-cache compatibility fields across Chat, Responses, Anthropic Messages, and Responses WebSocket surfaces. The proxy now normalizes legacy functions/function_call, maps web_search tools across protocols, rejects unsupported HTTP Responses continuation shapes before upstream dispatch, and applies configurable service_tier policy consistently before requests leave the server.

Constraint: Publication flow keeps day-to-day commits on dev and opens main PRs from a release branch.

Constraint: No new dependencies; web_search-only simulation reuses the existing local search route.

Rejected: Forward external HTTP previous_response_id to strict upstreams | it produces ambiguous continuation failures and stale retry behavior outside WebSocket state.

Rejected: Add a dedicated search dependency | existing /v1/search route is sufficient for synthetic server-tool responses.

Confidence: high

Scope-risk: moderate

Directive: Keep Responses HTTP continuation checks aligned with WebSocket continuation support before relaxing these guards.

Tested: npm run typecheck:server

Tested: npx vitest run --root . src/server/proxy-core/responsesPreflight.test.ts src/server/proxy-core/serviceTierPolicy.test.ts src/server/test-fixtures/protocol/non-cache-field-matrix.test.ts src/server/transformers/openai/responses/conversion.test.ts src/server/transformers/anthropic/messages/conversion.test.ts src/server/routes/proxy/chat.stream.test.ts src/server/routes/proxy/responses.codex-oauth.test.ts

Tested: npx vitest run --root . src/server/routes/proxy/responses.websocket.test.ts

Tested: npm run repo:drift-check

Not-tested: Full application build and full Vitest suite

Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-08 00:30:48 +08:00
kevinye13 a53c62885b fix(settings): persist model allowlist as JSON array 2026-04-27 20:35:18 +08:00
Xiang Li 99392341fe fix: handle empty-string column defaults in MySQL schema introspection
MySQL information_schema.COLUMNS.COLUMN_DEFAULT stores DEFAULT '' as an
empty string, not NULL. normalizeDefaultValueForColumn was treating any
empty rawDefaultValue as 'no default' and returning null, causing the
MySQL schema parity test to see defaultValue: null for post_refresh_probe_model
while schemaContract.json (generated from TypeScript schema) had "''".

Fix: when rawDefaultValue is empty string, return "''" for text/json columns
instead of null, so the round-trip through MySQL introspection matches the
contract.
2026-04-23 23:46:10 +08:00
Xiang Li 078ac4aa9d fix: add statement-breakpoint to migration 0025 and regenerate upgrade SQL
Better-SQLite3 requires --> statement-breakpoint between each statement
in a migration file; without it all statements are passed as a single
string to Database.prepare() which throws RangeError on multi-statement input.
2026-04-23 23:21:58 +08:00
Xiang Li cb5078468c fix: address CodeRabbit review for per-site probe
- Fix SSE abort: propagate AbortSignal to worker pool; close connection
  immediately on client disconnect without sending 'complete' event
- Fix Boolean coercion: use strict === true/=== 1 check instead of Boolean()
  to avoid Boolean('false') === true foot-gun
- Fix probe-now: parse and forward latencyThresholdMs from request body
- Fix api.ts probeSiteNow: add latencyThresholdMs to options type
- Fix backup import: restore postRefreshProbe* fields when inserting sites
  so that backup/restore round-trips preserve per-site probe config
- Fix latency threshold persistence: add postRefreshProbeLatencyThresholdMs
  column (migration 0026), save/load it in site editor, pass to
  runPostRefreshProbeIfEnabled so auto-probe also respects the threshold
- Fix state management: setProbeCompleted(false) at probe start; error
  branch also refreshes model lists and sets probeCompleted to show results
- Regenerate schema artifacts (mysql/postgres bootstrap+upgrade, contract)
2026-04-23 23:08:50 +08:00
Xiang Li 37924751f6 chore(db): add migration and regenerate schema artifacts for per-site probe columns
- Add drizzle/0025_site_post_refresh_probe.sql (ALTER TABLE sites ADD 3 columns)
- Update drizzle/meta/_journal.json (idx=24 entry)
- Regenerate mysql/postgres bootstrap+upgrade SQL and schemaContract.json
2026-04-23 22:50:57 +08:00
Xiang Li 46f23ddbb3 feat(sites): per-site model probe with streaming logs and auto-disable
- Move post-refresh probe settings from global config to per-site (sites table)
- Add manual 'probe now' button in site editor with real-time SSE log stream
- Use fetch+ReadableStream instead of EventSource to support Authorization header
- Concurrent probe execution (default 10 workers) via worker-pool pattern
- Add stop button to cancel in-flight probe while preserving completed results
- Add latency threshold: auto-disable models exceeding response time limit
- Treat inconclusive probe results as unsupported (auto-disable)
- Show specific failure reason in logs (timeout, no token, model not found, etc.)
- Refresh and display post-probe model status list (green=available, red=disabled)
- Remove probe settings from global Settings page and RuntimeSettingsPayload
2026-04-23 21:42:48 +08:00
cita-777 fa6edec83a Keep recent Docker tag deploys explicit and tag-safe
Review feedback pointed out two small but important operator-facing gaps in the
recent-tag card: one-click deploy should only be available when a real raw
Docker tag exists, and the digest that will be deployed should be visible on
the card instead of remaining implicit. This patch tightens the candidate
filter to require tagName and renders the digest metadata before the deploy
actions, with regression coverage for both behaviors.

Constraint: The deploy API still requires a raw Docker tag, not a normalized display value
Constraint: The recent-tag card should surface the exact digest operators are about to deploy
Rejected: Keep accepting normalizedVersion-only candidates | could enable one-click deploy with a non-tag display value
Rejected: Rely on displayVersion alone for digest visibility | digest presence should stay explicit even if display text changes later
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Any future recent-tag UI should treat tagName as the deployable identity and digest as separately visible metadata
Tested: src/web/pages/settings/UpdateCenterSection.test.tsx, npm run typecheck, git diff --check
Not-tested: Full PR checks rerun pending after push
2026-04-18 16:09:24 +08:00
cita-777 93912bb330 Publish the dev-tag discovery upgrade to main on a clean release branch
This release branch snapshots the latest dev work onto current main so the
update center can surface recent non-stable Docker tags without operators
looking them up manually. The branch keeps stable Docker discovery as the
primary path while carrying the new recent-tag auto-discovery, UI affordances,
and regression coverage through the repo's release flow.

Constraint: Publication must start from latest origin/main and merge origin/dev on a clean release branch
Constraint: Stable Docker Hub discovery semantics must remain intact while adding recent non-stable discovery
Rejected: Re-open or reuse the already-merged PR #494 branch | it has already been absorbed by main and deleted remotely
Rejected: Publish directly from dev | repo workflow requires a clean release branch to main
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Keep future dev-tag publication work on fresh release branches cut from origin/main; do not revive merged release branches
Tested: Focused update-center vitest suite, npm run typecheck, npm run repo:drift-check, npm run build:web, npm run docs:build, git diff --check (release branch)
Not-tested: Full npm test remains red because tmp/sub2api frontend suites are still broken in this repo snapshot
2026-04-18 15:32:44 +08:00
cita-777 c94e3148dd Let operators deploy recent dev Docker tags without manual lookup
The update center already allowed manual Docker tag deploys, but operators
still had to know and paste dev or branch tags by hand. This change keeps the
stable Docker Hub candidate as the main path while automatically surfacing the
most recent non-stable tags and their digests for one-click deployment.

Constraint: Stable Docker Hub discovery must remain the default candidate path
Constraint: Existing deploy API and helper protocol should stay unchanged
Rejected: Promote dev tags into the primary stable candidate slot | would blur stable and experimental release semantics
Rejected: Add a brand new backend deploy endpoint for recent tags | existing targetTag/targetDigest deploy path already covers the need
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Keep stable and recent non-stable Docker tag discovery distinct unless product semantics deliberately change
Tested: Focused vitest for update-center services/routes/UI, npm run typecheck, npm run repo:drift-check, npm run build:web, npm run docs:build, git diff --check
Not-tested: Full npm test remains red because tmp/sub2api frontend suites are still broken in this repo snapshot
2026-04-18 15:28:03 +08:00
Cita 262651a708 Merge pull request #494 from cita-777/release/feat-update-center-dev-tags-20260417
[chore] publish dev snapshot to main
2026-04-18 14:30:53 +08:00
cita-777 4a57e312f5 Align outbound fallback expectations with the reviewed Responses id shape
The last CI failure after the review cleanup was only a stale test expectation:
function_call fallback items now correctly use fc_* item ids while preserving the
call_* id in call_id. Updating the test keeps the suite aligned with the
Responses payload shape we intentionally adopted in the bridge.

Constraint: Keep the fix to the assertion only; the production behavior already matches the reviewed contract
Rejected: Revert the fc_* item id change | that would reopen the review thread we intentionally fixed
Confidence: high
Scope-risk: narrow
Directive: When bridge output semantics change intentionally, update sibling facade tests in the same PR so CI reflects the new contract immediately
Tested: Focused vitest for openai responses outbound/response bridge, Gemini request bridge, Settings payload rules; typecheck; git diff --check
Not-tested: Full npm test
2026-04-18 14:13:20 +08:00
cita-777 544324ed0a Restore the full payload-rule protocol list in Settings
One last review thread caught a real UI regression: the visual payload-rule
editor had drifted away from the shared protocol option source and no longer
exposed several active platform targets. Rebinding the dropdown to the shared
option list fixes the regression without inventing another source of truth.

Constraint: The fix should reuse the existing shared option list instead of creating another hardcoded protocol subset
Rejected: Expand the inline array manually | would repeat the same drift problem that caused the regression
Confidence: high
Scope-risk: narrow
Directive: Payload-rule protocol selectors should always read from the shared option source so Settings and the payload-rule parser stay aligned
Tested: settings.payload-rules vitest; typecheck; git diff --check
Not-tested: Full npm test
2026-04-18 14:01:26 +08:00
cita-777 1f464dc03d Close out the last review edge-cases before final merge
The remaining review threads were down to route alias hygiene, proxy-safe header
ordering, and a Gemini canonical tool-result mismatch. This commit makes the
alias/websocket behavior explicit, preserves contributor helper safety, and
teaches the canonical Gemini path to recover tool names and wrap function
results the same way the OpenAI-shaped path already does.

Constraint: Keep the last review fixes limited to the current branch so the release PR stays easy to reason about
Rejected: Defer the Gemini canonical fix to a later refactor | the review found a real functional mismatch and the fix stayed localized to the request bridge
Confidence: high
Scope-risk: narrow
Directive: Keep canonical-to-provider bridges internally consistent; if one path resolves tool names or wraps results, the sibling path should not diverge silently
Tested: Focused vitest for Gemini request bridge, route aliases, upstream request builder, responses response bridge, contributor updater; typecheck; git diff --check
Not-tested: Full npm test; any broader end-to-end Gemini live-provider behavior outside the covered bridge tests
2026-04-18 13:46:57 +08:00
cita-777 20f06d391c Tighten alias and header edge-cases called out in review
The latest review pass found a few more concrete edge-cases that were still
cheap to close: invalid /responses aliases could still rewrite typos, websocket
session headers should prefer proxy-safe dashed forms, contributor rendering
needed an input guard, and several upstream request/response helpers still had
small contract mismatches around Accept/beta handling and synthesized tool ids.
These fixes keep the release branch behavior explicit while the PR remains open.

Constraint: Keep changes surgical and well-covered so the review cleanup does not destabilize the already-green release branch
Rejected: Leave these for post-merge cleanup | they were still active review threads with straightforward fixes
Confidence: high
Scope-risk: narrow
Directive: When alias routes exist only for ergonomics, reject unknown subpaths loudly instead of silently rewriting them
Tested: Focused vitest for contributor updater, route aliases, upstream request builder, openai responses response bridge; typecheck; git diff --check
Not-tested: Full npm test; the remaining Gemini review thread that likely needs a broader canonical-tool-result contract decision
2026-04-18 13:38:46 +08:00
cita-777 e795f22367 Settle the last concrete review regressions on the release branch
A few review threads still pointed at real behavior mismatches: Anthropic tool
JSON deltas were still trimming whitespace, Responses conversion still raised
low token caps to the floor, and the bare /responses GET alias returned upgrade
messaging that did not match the actual websocket entrypoint. This commit makes
those behaviors explicit and locks them with focused tests.

Constraint: Keep the release branch green while fixing only the review findings that have a clear, testable contract
Rejected: Leave these for a follow-up cleanup PR | they were low-diff and directly blocked comment resolution on the current release PR
Confidence: high
Scope-risk: narrow
Directive: Preserve raw stream delta text unless a downstream protocol explicitly requires normalization; whitespace can be semantic in incremental payloads
Tested: Focused vitest for anthropic stream bridge, responses conversion, route aliases; typecheck; git diff --check
Not-tested: Full npm test; the remaining review threads that still need broader product decisions
2026-04-18 13:28:50 +08:00
cita-777 02520255db Clear remaining low-risk review debt on the release branch
The PR still had a few targeted review threads around contributor pagination,
route-layer passthroughs, dead header fallbacks, and synthetic response ids.
These are small enough to settle directly on the release branch without
broadening the merge scope, and they tighten the repo back toward the
service-owned boundaries this refactor is aiming for.

Constraint: Keep the changes narrow and regression-covered so the release PR stays green while review threads are closed out
Rejected: Leave the minor threads for follow-up after merge | they were isolated enough to fix now and would keep noise on the PR
Confidence: high
Scope-risk: narrow
Directive: When a route shim stops serving any route-local behavior, point callers at the owning service instead of keeping a passthrough around
Tested: Focused vitest for contributor updater, openai responses response bridge, upstream request builder, stats proxy logs, architecture boundaries; typecheck; repo drift check; git diff --check
Not-tested: Full npm test; unresolved review threads that still require larger product decisions
2026-04-18 13:19:29 +08:00
cita-777 4b5d045b00 Address high-priority review gaps before merging the dev snapshot
The release branch still had unresolved review comments around payload-rule
atomicity, brand blocking, compact fallback controls, and response
compatibility edge-cases. This patch pulls those behaviors back in line with
the intended contracts and adds focused regression coverage for the fragile
bridges.

Constraint: The fixes must stay narrow to the PR branch so review/merge can continue without reopening the larger dev snapshot conflict set
Rejected: Leave outdated-looking threads unresolved until after merge | reviewers still see concrete unfixed regressions in the current release branch
Rejected: Re-run another broad merge from dev/main | too risky while the PR branch is already green and mergeable
Confidence: medium
Scope-risk: moderate
Directive: If these release-branch fixes need to persist for future release cuts, backport them onto dev instead of re-fighting the same review threads next time
Tested: Focused vitest for settings events, brand matcher, compact responses, codex compatibility, anthropic stream bridge, openai chat response bridge; typecheck; repo drift check; git diff --check
Not-tested: Full npm test; live PR thread resolution state after push
2026-04-18 13:05:52 +08:00
cita-777 57db7fd107 Keep PR audit informational without leaving the check red
The CI workflow already described production dependency audit as an
informational PR signal, but the job still surfaced as a failing check.
That left release PRs in an unstable state even after the real merge-gate
jobs were green. This keeps PR audits visible as warnings while still
letting main-branch pushes fail if production dependency audit actually
returns a non-zero exit.

Constraint: Preserve production audit visibility while avoiding false-red PR status
Rejected: Remove audit from CI entirely | loses vulnerability visibility
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep audit informational on pull requests unless branch protection is intentionally tightened later
Tested: YAML parse via ruby; git diff --check
Not-tested: Full GitHub Actions rerun pending after push
2026-04-17 23:36:51 +08:00