47 Commits
Author SHA1 Message Date
Gemini Nexus Bot a905877c76 feat: bump version to 0.14.0
Includes all changes from this release cycle:
- Top header navigation (sidebar removed)
- Accounts screen decomposition and visual redesign
- Dev/prod environment isolation
- Usage Analytics with accurate averages, cost reporting, OpenRouter pricing
- Monitor moved to Usage with per-request token/cost tracking
- Clickable traffic logs with expandable JSON body viewer
- OpenCode IDE config in Quick Setup
- API Proxy reorganization (flattened tabs)
- CI/CD pipeline fixes (release config, Node version, pnpm alignment)
- Repository cleanup (~80MB of binaries removed)
2026-05-02 00:32:21 -03:00
Gemini Nexus Bot 713c4497c6 feat(proxy): add OpenCode IDE config and fix service availability
- Add opencode to SupportedIde with JSON providers.json output
- Add defaultModel parameter for IDE config generation
- Add model selector dropdown in ToolsTab for IDE configurations
- Use getServiceOptional for graceful degradation when proxy is stopped
- Add fallback IDE config generation using ConfigManager when NestJS is offline
- Update IPC router schema to accept defaultModel parameter
2026-05-02 00:30:18 -03:00
Gemini Nexus Bot 641c739b64 feat(proxy): enrich traffic logs with model and token metadata
- Add model to logInbound metadata
- Add model, tokensPrompt, tokensCompletion, tokensTotal to logOutbound metadata
- Enrich SSE streaming with token metadata from final usage chunk
- Add metadata parameter to logOutbound method signature
- Data persisted in traffic_logs.metadata_json for per-request cost calculation
2026-05-02 00:29:55 -03:00
Gemini Nexus Bot 5c44a622a8 feat(core): isolate dev and production environments
- Add IS_DEV_ENVIRONMENT flag to paths.ts for automatic detection
- Dev uses 'Gemini Nexus Dev' app data dir and '.geminiNexus-agent-dev' agent dir
- Dev proxy defaults to port 8046, production stays on 8045
- Move app.setName() before packetLogPath to ensure correct userData path
- Config, DB, logs, and ORPC packets fully isolated between dev and prod
2026-05-02 00:28:22 -03:00
Gemini Nexus Bot 68474b56dc feat(proxy): add OpenAI Responses API compatibility for Open CoDesign
- Normalize Responses API tool format ({name, parameters} at top level)
  to Chat Completions format ({function: {name, parameters}})
- Handle 'developer' role as system prompt (OpenAI's newer equivalent)
- Add null/non-array guards to convertOpenAIPartsToAnthropicContent and
  extractOpenAITextContent to prevent 'content is not iterable' crashes
- Support input_text, output_text, and reasoning item types in Responses
  API input parsing
- Forward reasoning.effort to Claude adaptive thinking config
- Extend JSON schema sanitization blacklist with draft-2020 keywords
  (patternProperties, , unevaluatedProperties, etc.)
- Add fallback for untyped items with role/content in Responses API input
- Add diagnostic logging for /v1/responses input conversion
2026-04-29 04:39:15 -03:00
Gemini Nexus Bot 9bf7c46ff6 fix: lazy-initialize api-logger to prevent EACCES in CI environments
The DailyRotateFile transport was creating directories at module load
time, causing EACCES permission errors when tests import modules that
transitively reach api-logger.ts.

Refactored to use a Proxy that lazily initializes the winston logger
on first method call. This eliminates side effects during module
loading while maintaining the same public API.
2026-04-29 03:39:28 -03:00
Gemini Nexus Bot 6e568dd866 fix: resolve type-check and unit test failures for CI
- vite.renderer.config: remove deprecated babel option from @vitejs/plugin-react v6
- server/main.ts: cast fastify instance to fix version mismatch TS error
- proxy-tool-streaming.test: pass 3 args to ProxyService constructor (added TokenUsageService mock)
- input.test: update expected classes (rounded-lg, bg-muted/50)
- StatCard.test: update selectors and accent classes to match component (rounded-lg, /8 opacity, bg-white/[0.04])
- paths.test: relax executable path assertion for CI environments
- cloud-repo.test: add fs mock to prevent EACCES on /mock/db
- cloudHandler-sync.test: add traffic-logger mock to prevent EACCES on /mock/
2026-04-29 02:56:03 -03:00
Gemini Nexus Bot a648f2a281 fix: token tracking pipeline + premium usage dashboard redesign
Backend fixes:
- Fix totalTokens defaulting to 0 when API omits totalTokenCount (now computes prompt+completion)
- Fix streaming metadata extraction: unwrap response wrapper in Anthropic/Gemini handlers
- Fix Zod schemas: handle SQL SUM(null) with nullable().transform()
- Add is_estimated column migration to token_usage table

Frontend redesign:
- Rewrite Usage page with area charts (nivo/line), horizontal bar model ranking
- StatCard: add trend indicators (% vs previous period) and inline SVG sparklines
- Premium color palette, prompt/completion ratio bar, top models mini-list
- Live indicator with 15s auto-refresh

Design system migration:
- Standardize all components on Gemini Nexus tokens (rounded-xl, border-white/[0.06])
- Refine UI components, proxy tabs, cloud account list, provider groups
2026-04-29 01:43:48 -03:00
Gemini Nexus Bot bac7b5591e style(design): apply Minimal Dark Mode design system\n\n- Switched to complete Dark Mode (OLED-friendly)\n- Established standard color palette matching modern technical aesthetics\n- Changed font to Plus Jakarta Sans for increased legibility\n- Enforced dark mode as default in App.tsx\n- Fixed several React cascading render (setState in useEffect) warnings 2026-04-28 03:49:34 -03:00
Gemini Nexus Bot 69e455a565 fix(proxy): ensure OpenAI tool call streaming emits proper delta chunks and increase body limit
- Emit tool call id+name in first SSE delta and arguments in subsequent deltas
- Split large tool arguments into 1000-char chunks to prevent framing issues
- Set FastifyAdapter bodyLimit to 10MB to handle large payloads
- Add TDD tests for tool call streaming verification
2026-04-27 01:14:44 -03:00
Gemini Nexus Bot 04014b8c7d chore: commit current working state with config updates, test fixes, and continuity ledgers 2026-04-27 00:43:57 -03:00
Gemini Nexus Bot afe8859f16 test: fix broken unit tests, add missing fixtures, and stabilize CI pipeline
- Fix os module mock pattern for Vitest v4 in proxy-ide-config tests

- Fix enterprise oauth_client_key expectations in cloudHandler-sync and token-manager-parity tests

- Fix proxy-controller integration test argument expectations

- Add missing proxy-parity JSON fixtures (OpenAI tools, Anthropic tool-use, Gemini SSE)

- Add reasoning_content mapping to convertClaudeToOpenAIResponse

- Fix google-api service test env var cache leak with resetModules + dynamic imports

- Fix proxy-metrics timer tests by calling onModuleInit in beforeEach

- Fix locale-sensitive number formatting in StatCard tests

- Add missing test files to version control (components, hooks, ipc, mocks, server, utils)

- Fix CI workflows: testing.yaml (use vitest run, add type-check job, npm cache), lint.yaml and format.yaml (add npm cache, concurrency, fix job names)
2026-04-23 16:57:58 -03:00
Gemini Nexus Bot bf4bcf4f96 fix: apply code review fixes (fire-and-forget usage, theme-aware chart colors) 2026-04-23 03:00:58 -03:00
Gemini Nexus Bot fd1b2b8bc0 fix: resolve TypeScript type-check errors
- Add cacheHitRate to ProxyMetricsService, handler, and router schema
- Fix StatCard to support string values and purple accent
- Fix duplicate tabs keys in i18n translations (EN/ZH/RU)
- Add missing cacheStatus translations across all languages
2026-04-23 02:50:09 -03:00
Gemini Nexus Bot 0be7d7fea2 feat(proxy): implement metrics persistence, traffic logs DB, and advanced monitoring
- Add SQLite schema for proxy metrics and traffic logs
- Implement ProxyMetricsRepo with historical aggregates
- Add TrafficLogsRepo for DB-backed traffic log queries
- Create proxy-advanced IPC handlers (metrics, traffic logs, circuit breaker, parity)
- Add ProxyMetricsService with connection snapshots and cleanup
- Add ProxyReplayService and ProxyIdeConfigService
- Implement MonitorTab and ToolsTab for advanced proxy features
- Add TrafficLogTable with sorting and filtering
- Fix i18n keys for proxy metrics
- Fix generateIdeConfig type mapping
- Update proxy routes with advanced tab integration
2026-04-23 00:57:01 -03:00
Gemini Nexus Bot 425b0009b8 fix(usage): apply code review fixes - SSE passthrough type, per-chart errors, Select component 2026-04-22 15:31:54 -03:00
Gemini Nexus Bot 9b37bdb2d9 fix(usage): address code review findings - SQL injection, stream usage recording, DB singleton 2026-04-22 14:34:39 -03:00
Gemini Nexus Bot 98c08bd64f fix(proxy): register TokenUsageService in ProxyModule providers 2026-04-22 13:58:26 -03:00
Gemini Nexus Bot 1a1c0acd16 feat(proxy): inject token usage recording into all handler paths 2026-04-22 13:30:46 -03:00
Gemini Nexus Bot ce21283170 feat(usage): add token usage service and IPC router endpoints 2026-04-22 13:30:34 -03:00
Gemini Nexus Bot 2c81d129f9 fix(streaming): resolve Gemini v1internal SSE wrapped format and OpenCode compatibility
- Fix processStreamResponse to unwrap json.response ?? json for Gemini v1internal wrapped SSE chunks
- Add initial role:assistant delta chunk for Vercel AI SDK / OpenCode compatibility
- Add trafficLogger console transport for real-time debugging
- Add upstream request/response logging throughout proxy paths
- Update proxy-controller.integration and proxy-retry-mock tests for new signatures
- Add comprehensive proxy-stream-debug unit tests (8 cases including wrapped format regression)
- Add OpenCode integration documentation
2026-04-22 05:26:57 -03:00
Gemini Nexus Bot 5b130aca66 fix(stream): restore processStreamResponse to original working behavior
The initial role chunk (role:'assistant', content:'') added in a3eabc2
was causing the OpenCode TUI to receive an empty first delta and
discard all subsequent content, showing only the completion time with
no text output.

Restored to the exact streaming behavior from e524a340 that worked:
- Remove the pre-emptive initial chunk entirely
- Move hasEmittedChunk=true back inside pushChunk (original position)
- Use reasoning_content delta field for thought parts instead of
  wrapping in <think> tags (which corrupts plain text responses)
- Remove streamOptions/include_usage/lastUsageMetadata tracking
  (not present in the working version)
- Remove isThinking state machine (was adding </think> noise to output)

Kept from the spec compliance work (a3eabc2):
- toolCallIndex counter for correct finish_reason:'tool_calls' mapping
- Comment explaining why we override Gemini's STOP finish reason
2026-04-22 03:26:51 -03:00
Gemini Nexus Bot a3eabc2aaa fix(api): full OpenAI-spec compliance for OpenCode integration
Route fixes:
- Add POST /v1/messages/chat/completions alias so OpenCode clients
  misconfigured with baseURL ending in /v1/messages no longer get 404

Session affinity:
- Extract x-session-affinity HTTP header (sent by OpenCode) and use it
  as the session key for token stickiness, falling back to body-level
  session_id fields if the header is absent

Tool calling (streaming):
- finish_reason is now 'tool_calls' when function calls were emitted in
  the stream (Gemini always sends STOP, so we check toolCallIndex > 0)
- createSyntheticOpenAIStream (stream fallback path) now emits all
  tool_call deltas before the finish chunk instead of silently dropping
  them when content is null

Tool calling (non-streaming):
- content is now always null when tool_calls are present, satisfying
  strict clients that reject non-null content alongside tool_calls
- system_fingerprint field added to OpenAIChatResponse interface and
  response builder for OpenAI spec compliance

Usage accounting:
- thoughtsTokenCount is now included in completion_tokens and
  total_tokens for the streaming usage chunk, fixing undercount for
  thinking/reasoning model runs
2026-04-22 03:17:46 -03:00
Gemini Nexus Bot 83489d5084 Merge branch 'vk/5b60-veja-o-que-ja-te' into main
Add comprehensive API request/response logging with structured winston logs
2026-04-22 00:21:44 -03:00
Gemini Nexus Bot 0454aecf70 changes 2026-04-22 00:09:29 -03:00
Gemini Nexus Bot 27da62afc9 feat(logging): add comprehensive API request/response logging with structured winston logs
- Add dedicated API logger (api-logger.ts) with winston daily rotation
- Create Fastify plugin (api-logging.plugin.ts) to intercept all API requests/responses
- Log request start, body, response, errors, and summary with precise timestamps
- Auto-mask sensitive data using existing sanitizeObject utility
- Register API logging plugin in NestJS bootstrap (server/main.ts)
- Add npm run dev script with cross-env for automatic DEBUG on Windows
- Install cross-env as devDependency for cross-platform env vars
2026-04-22 00:07:30 -03:00
Gemini Nexus Bot 433dccbaa9 feat: complete rebranding to Gemini Nexus with improved UI, proxies and documentation 2026-04-22 00:00:56 -03:00
vin bc35b96b5d refactor: standardize runtime guard patterns with lodash-es (#154)
* refactor(ui): replace runtime type guards with lodash-es predicates

* refactor(runtime): migrate typeof checks to lodash-es in core modules

* refactor(ipc): standardize runtime guards with lodash-es

* test(refactor): align runtime guard checks with lodash-es

* docs(agents): add lodash-es runtime guard skill summary
2026-04-12 11:41:56 +08:00
Draculabo 4fa0a3c63d feat(proxy): improve quota fallback and proxy parity handling 2026-04-11 16:47:57 +08:00
vd ed0dd811a8 feat: account management overhaul + 7 issue resolutions (#147)
- Add smart JSON export/import with schema validation and deduplication
- Add per-account proxy configurations (Issue #79)
- Add advanced account sorting engine (Issues #126 & #99)
- Add compact horizontal layout, AI credits, inline model visibility (Issues #145 & #134)
- Add desktop push notifications for low quota (Issue #53)
- Fix Arch Linux AUR process detection bug (Issue #117)
- Default theme set to Dark Mode (it's better)
- UI Polishing: Improved sort dropdown and symmetrical dialog layouts
- Dev Mode: Resolved port conflicts and single-instance locks
- Updated README and README.zh-CN with new features
2026-04-06 20:32:42 +08:00
Draculabo 20fffff29c feat(proxy): add upstream error and rate-limit tracking support 2026-03-06 21:56:30 +08:00
Draculabo 5401e40943 feat(proxy): improve parity, rate limiting, and token scheduling 2026-03-06 21:50:18 +08:00
AngeloooooandDraculabo 8ed4593f73 Refactor Gemini model display: filter old versions, group low/high pкo, and improve naming (#114)
* Refactor Gemini model display: filter old versions, group low/high pro, and improve naming

* Fix potential negative minutes and refine Gemini 3 Pro grouping logic based on PR feedback

* The account change process has been sped up

* Address PR review: enhance error message and parameterize polling interval in process handler

* Address PR review: fix potential race condition in database backup logic

* fix: prevent renderer white screen and harden sentry gating

* feat:  localize model labels

* chore: enable hoisted node-linker

* chore: ignore .agent/.claude/.codex in prettier

---------

Co-authored-by: Draculabo <[email protected]>
2026-02-19 19:37:30 +08:00
ArtemisAIandDraculabo 1e59a1c901 feat: Implement provider groupings with account calculator and compre… (#113)
* feat: Implement provider groupings with account calculator and comprehensive fixes

- Add provider detection utilities (detectProvider, PROVIDER_REGISTRY) for Claude/Gemini/Others categorization
- Implement grouping logic (groupModelsByProvider, calculateProviderStats, calculateAccountStats) with health status calculation
- Create useProviderGrouping hook for collapsible state management and persistence
- Add ProviderGroup component with health indicators, progress bars, and model visibility integration
- Enhance CloudAccountList with account-level calculator showing overall percentage and earliest reset time
- Implement grid layout selector (auto/2-col/3-col/list) with config persistence and tooltips
- Add global quota aggregate bar across all accounts in top statistics
- Fix model visibility settings regression by accessing account.quota.models instead of account.quota
- Show 'Rate Limited' instead of '0%' for exhausted quotas with consistent getQuotaLabel function
- Add comprehensive i18n translations for layout selector and rate limited labels (en, zh-CN, ru)
- Disable batch operations when provider groupings are enabled to prevent conflicts
- Include unit tests for provider detection logic and grouping functionality

Addresses critical issues: model list regression, rate limited display, layout control, global quota visibility, and consistent quota labeling across all components.

* fix: resolve ESLint no-ex-assign violations in proxy service

- Fix exception parameter reassignment in catch blocks
- Rename catch parameters to avoid no-ex-assign rule violations
- Maintain same error handling logic while complying with linting rules

* fix: add missing Models tab to settings page

- Add Models tab between General and Proxy tabs
- Import and integrate ModelVisibilitySettings component
- Fix critical regression where model visibility settings were inaccessible

* fix: add missing React hook imports in settings route

* test: remove obsolete tests for removed controller APIs

---------

Co-authored-by: Draculabo <[email protected]>
2026-02-18 16:38:15 +08:00
gu yan 4dc4e4e5a7 add model list endpoint (#96)
* add model list endpoint

* fix: guard models list endpoint errors
2026-02-12 00:38:12 +08:00
vin caf9d5849a fix: project id fallback and stream error regression (#94)
* fix(proxy): harden project id handling for upgraded accounts

* fix(proxy): parse stream error payloads to preserve upstream project errors
2026-02-11 17:11:27 +08:00
vin ab78d93252 fix: project id forwarding regression (#93)
* fix(proxy): avoid empty project context and hydrate project_id from account token

* test(proxy): add regressions for empty project and token project_id hydration

* test(scripts): add live request validator for project_id forwarding
2026-02-11 12:36:01 +08:00
vin e5037dabcb chore(lint): remove unused imports via eslint unused-imports (#89) 2026-02-11 02:54:23 +08:00
vin 13f10fe32f feat: implement protocol parity and harden upstream handling (#88)
* feat: implement protocol parity and harden upstream handling

* docs(agents): add lodash-es utility method and named import guideline
2026-02-11 00:42:39 +08:00
saianilsingi 476d297e4b fix(proxy): route Claude Code CLI requests on /v1/chat/completions to Anthropic handler (#61)
* fix(proxy): route Claude models from chat completions to anthropic handler

* style(proxy): minor formatting cleanup
2026-02-04 18:22:53 +08:00
Draculabo 5772e2e90e feat: implement stability fixes and enhance error handling 2026-01-16 02:51:29 +08:00
Draculabo b0ec96d4a6 fix: Converting circular structure to JSON 2026-01-15 22:58:05 +08:00
Draculabo fb13826afd feat: identity injection 2026-01-10 04:08:55 +08:00
Draculabo 64e27ab821 feat: integrate antigravity adapter 2026-01-10 01:07:09 +08:00
Draculabo 098cbe3eb9 fix: server di error 2026-01-10 01:07:09 +08:00
Draculabo bc775d4fd6 feat: add boss key 2026-01-10 01:07:09 +08:00
Draculabo e7087bc4b1 feat: migrate gateway to nestjs 2025-12-24 23:26:55 +08:00