Skip to content

Release v0.4.2#600

Merged
ding113 merged 8 commits intomainfrom
dev
Jan 12, 2026
Merged

Release v0.4.2#600
ding113 merged 8 commits intomainfrom
dev

Conversation

@ding113
Copy link
Owner

@ding113 ding113 commented Jan 12, 2026

Summary

Release v0.4.2 merging 7 PRs from dev to main, including major i18n infrastructure improvements, Edge Runtime compatibility fixes, Codex session management enhancements, and multiple bug fixes.

Related Issues:


Release Highlights

🌍 i18n Infrastructure Overhaul (#588)

Major internationalization refactoring with quality gates:

  • Settings messages split: Replaced monolithic settings.json with modular directory structure (messages/<locale>/settings/**/)
  • Translation quality gates: Added automated audit scripts with CI fail gates
    • R1: Prevent placeholder Chinese text in non-Chinese locales
    • R2: Validate placeholders/tokens preservation (e.g., {count})
    • R3: Glossary and terminology consistency
    • R4: No emoji in messages/**/*.json files
  • Content completeness: Fixed missing translations in ja/zh-TW across 85 i18n files
  • Documentation: Added docs/i18n-pr-checklist.md, docs/i18n-settings-split.md, and docs/i18n-translation-quality.md with Chinese versions

🔧 Edge Runtime Compatibility (#589)

Fixed Next.js build warnings for Edge Runtime caused by process.once usage:

  • Lazy initialization in AsyncTaskManager to defer Node.js APIs
  • Dynamic imports in cloud-price-updater to prevent static bundling
  • Environment detection: skips initialization in Edge/CI/build contexts
  • 100% test coverage for Edge Runtime code paths

🎯 Codex Session Management (#599)

Auto-completion of Codex session identifiers for improved session stickiness:

  • Priority chain: header.session_idheader.x-session-idbody.prompt_cache_keybody.metadata.session_id
  • UUID v7 generation with Redis fingerprint caching (keyId + IP + UA + message hash)
  • Feature flag: enableCodexSessionIdCompletion (default: true)
  • Configurable TTL via SESSION_TTL environment variable

Changes by Category

Features

Provider Management

Documentation

Bug Fixes

Provider UI (#593)

  • Fix inability to remove custom whitelisted models from provider configuration
  • Issue: Models manually added but not in availableModels list couldn't be deselected
  • Solution: Merge availableModels + selectedModels in rendering logic

Thinking Block Rectifier (#594)

  • Extend rectifier to detect signature: Field required error pattern
  • Previously only detected invalid signature format, now also handles missing signature
  • Add Error Rule 72 with friendly user-facing message
  • Related to cross-channel thinking block compatibility

Database Migrations

This release includes 2 new migrations:

  1. 0053_watery_madame_hydra.sql: Alter users.provider_group and keys.provider_group from varchar(50) to varchar(200)
  2. 0054_tidy_winter_soldier.sql: Add system_settings.enable_codex_session_id_completion (default: true)

Migration Strategy:

  • Automatic migration if AUTO_MIGRATE=true (recommended)
  • Manual migration: bun run db:migrate

Breaking Changes

None. This is a backward-compatible release.


Files Changed

  • 100 files changed (+20,747/-11,179)
  • 85 i18n files restructured and updated
  • 2 database migrations
  • 4 new documentation files
  • Multiple test files added/updated for new features

Key Affected Areas

  • messages/*/settings/ - Complete restructure from monolithic to modular
  • drizzle/ - Database schema changes
  • src/lib/async-task-manager.ts - Edge Runtime compatibility
  • src/app/v1/_lib/codex/session-completer.ts - New session completion logic
  • src/app/[locale]/settings/providers/ - Provider UI fixes
  • docs/ - New i18n documentation and guidelines

Testing

All PRs in this release passed:

  • bun run lint
  • bun run typecheck
  • bun run test (with targeted coverage ≥80%)
  • bun run build (Edge Runtime warnings eliminated)
  • ✅ i18n quality gates: bun run i18n:audit-placeholders:fail and bun run i18n:audit-messages-no-emoji:fail

Upgrade Notes

For Deployers

  1. Database Migration Required: Run bun run db:migrate or set AUTO_MIGRATE=true
  2. Environment Variables: No new required variables; SESSION_TTL remains optional
  3. Breaking Changes: None

For Developers

  1. i18n File Structure Changed:

    • DO NOT edit messages/<locale>/settings.json (removed)
    • Edit files in messages/<locale>/settings/**/ instead
    • Run node scripts/sync-settings-keys.js after key changes
    • Run i18n audit scripts before committing: bun run i18n:audit-placeholders:fail and bun run i18n:audit-messages-no-emoji:fail
  2. New Documentation:

    • Read docs/i18n-pr-checklist.md for i18n change guidelines
    • See docs/edge-runtime-process-once.md for Edge Runtime compatibility patterns

Contributors

This release includes contributions from:

Special thanks to the community for reporting issues #590 and #592!


Full PR List


Target Branch: main (from dev)
Release Version: v0.4.2
Previous Version: v0.4.1 (820b519)

Description generated by Claude AI

YangQing-Lin and others added 7 commits January 12, 2026 00:16
* fix: skip async task manager init on edge

* fix: avoid static async task manager import

* test: cover edge runtime task scheduling

* chore: document edge runtime process.once fix

* chore: record edge runtime warning baseline

* fix: drop NEXT_PHASE and lazy-init async task manager

* test: isolate NEXT_RUNTIME in cloud price sync tests

* docs: stabilize edge process.once repro baseline

* docs: make rollback instructions hashless

* docs: add grep checklist for edge warning audit

* chore: run regression gate and align docs

* test: cover edge runtime guard on register

* Update src/lib/async-task-manager.ts

补充 NEXT_PHASE === "phase-production-build" 检查

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* chore: format code (fix-edge-runtime-process-once-bee7e19)
* refactor(i18n): split settings json into smaller files

* refactor(i18n): load settings from split module

* refactor(i18n): remove legacy settings.json

* chore(i18n): update sync-settings-keys for split layout

* test(i18n): add split settings guards

* chore: align biome schema version

* chore(i18n): document messages loading contract

* chore(i18n): add settings split verification notes

* chore: format code (refactor-i18n-split-settings-3f48fec)

* chore: fix i18n request formatting

* chore: format code (refactor-i18n-split-settings-a1eff62)

* fix: replace settings placeholder translations

* chore: verify settings sync script is idempotent

* test: run i18n settings split guards

* test: add audit for zh-CN placeholder settings strings

* chore: apply biome formatting

* chore: document manual i18n settings verification

* fix: translate all providers filter in ja

* fix: translate all providers filter in zh-TW

* fix: translate providers section copy in zh-TW

* fix: translate providers section copy in ja

* feat: extend placeholder audit output

* feat: add allowlist for placeholder audit

* docs: define i18n translation quality rules

* chore: add i18n audit fail commands

* docs: add i18n PR checklist

* chore: format i18n audit tests

* fix: translate dashboard placeholders

* fix: translate myUsage placeholders

* fix: enforce locale-specific parentheses

* fix: start translating provider form strings

* fix: translate provider form strings

* fix: translate provider guide content

* test: add ja dashboard parentheses guard

* test: add zh-TW dashboard parentheses guard

* test: add zh-TW myUsage parentheses guard

* chore: translate ja provider form strings

* chore: translate zh-TW provider form strings

* chore: translate ja providers guide

* chore: translate zh-TW providers guide

* chore: refine zh-TW dashboard strings

* chore: translate ja providers strings

* chore: translate zh-TW providers strings

* chore: refine zh-TW api test strings

* chore: translate zh-TW settings small modules

* chore: translate ja settings small modules

* chore: clear i18n placeholders in settings

* chore: format code (refactor-i18n-split-settings-2437d19)

* test: fix biome formatting in i18n test

* chore: verify Biome lint gate (I18NE-030)

* chore: add messages emoji audit script (I18NE-010)

* fix: remove emoji from messages warnings (I18NE-040)

* test: add messages no-emoji audit gate (I18NE-050)

* docs: add zh-CN i18n docs (I18NE-020)

* docs: add messages no-emoji rule (I18NE-060)

* chore: run full regression checks (I18NE-070)

* docs: add i18n PR evidence template (I18NE-080)

* fix: make messages no-emoji audit path-sep safe

* docs: add bun alias for messages no-emoji audit

* fix: detect keycap and flag emoji sequences in i18n message audits
…rectifier (#594)

- Extend detectThinkingSignatureRectifierTrigger to match 'signature: Field required'
- Add Rule 72 for friendly error message when signature field is missing
- Add comprehensive test cases for the new detection logic

This fixes an issue where switching from non-Anthropic to Anthropic channels
with thinking blocks missing signature fields would fail without proper handling.
…ni v1beta (#597)

- Add OpenAI GPT-5.2 model configuration with reasoningEffort options
- Add GPT-5.2-small variant using medium reasoning effort
- Fix Gemini baseURL to use /v1beta endpoint
- Update i18n strings to reflect different baseURLs per provider
@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

Important

Review skipped

Too many files!

150 files out of 300 files are above the max files limit of 150.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link

greptile-apps bot commented Jan 12, 2026

Too many files changed for review. (332 files found, 100 file limit)

@github-actions
Copy link
Contributor

🧪 测试结果

测试类型 状态
代码质量
单元测试
集成测试
API 测试

总体结果: ✅ 所有测试通过

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ding113, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces significant improvements to the application's internationalization infrastructure, enhancing maintainability and consistency across supported languages. It also includes essential database schema adjustments to support new features and addresses a critical build warning related to Edge Runtime compatibility, ensuring a more robust and future-proof system.

Highlights

  • Internationalization (i18n) Refactoring: The i18n settings have been refactored into a modular structure, breaking down large JSON files into smaller, more manageable ones across multiple languages (English, Japanese, Russian, Simplified Chinese, Traditional Chinese). This includes new documentation for i18n quality rules and PR checklists.
  • Database Schema Updates: New Drizzle ORM migrations have been added to modify the provider_group column in keys and users tables to varchar(200) with a default value, and to introduce a new enable_codex_session_id_completion boolean column to the system_settings table.
  • Edge Runtime Compatibility Fix: Documentation has been added detailing a fix for a process.once build warning in the Edge Runtime, involving conditional initialization of AsyncTaskManager and dynamic imports.
  • Translation Improvements: Emoji characters have been removed from several provider-chain.json messages across different languages, and minor text adjustments have been made for clarity and consistency in Japanese and Traditional Chinese translations.
  • Biome.js Schema Update: The Biome.js schema version has been updated from 2.3.10 to 2.3.11.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces significant updates across several areas, primarily focusing on internationalization (i18n) improvements, database schema migrations, and minor dependency updates. For i18n, new documentation files (CONTRIBUTING.md, docs/i18n-pr-checklist.md, docs/i18n-pr-checklist.zh-CN.md, docs/i18n-pr-evidence-2026-01-11.md, docs/i18n-settings-split.md, docs/i18n-settings-split.zh-CN.md, docs/i18n-translation-quality.md, docs/i18n-translation-quality.zh-CN.md) have been added to establish clear guidelines, checklists, and quality rules (R1-R4, including no-emoji policy) for translations, especially for settings, dashboard, and myUsage sections. The settings message files for English, Japanese, Russian, Simplified Chinese, and Traditional Chinese locales have been refactored from single JSON files to a split directory structure for better organization, and existing translation strings have been updated to remove emojis and standardize formatting. Additionally, a new document (docs/edge-runtime-process-once.md) details a fix for an Edge Runtime process.once build warning by conditionally initializing AsyncTaskManager and dynamically importing it in cloud-price-updater. Database schema changes include modifying provider_group columns in keys and users tables to varchar(200) with a default of 'default', and adding a new boolean column enable_codex_session_id_completion to the system_settings table. Finally, the biome.json schema version has been updated to 2.3.11.

@github-actions github-actions bot added the size/XL Extra Large PR (> 1000 lines) label Jan 12, 2026
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

This is a well-structured release PR (v0.4.2) merging 7 PRs from dev to main. The changes include major i18n infrastructure improvements, Edge Runtime compatibility fixes, Codex session management enhancements, and multiple bug fixes. The code quality is high with comprehensive test coverage and proper error handling throughout.

PR Size: XL

  • Lines changed: 31,926 (20,747 additions + 11,179 deletions)
  • Files changed: 332

Note on PR Size: This is a release PR consolidating multiple feature PRs. The large size is primarily due to:

  • i18n file restructuring (85 JSON files split from monolithic settings.json)
  • Drizzle migration snapshots (auto-generated, ~4,700 lines)
  • Comprehensive test coverage for new features

For future releases, consider smaller, more frequent releases to reduce review complexity.

Issues Found

Category Critical High Medium Low
Logic/Bugs 0 0 0 0
Security 0 0 0 0
Error Handling 0 0 0 0
Types 0 0 0 0
Comments/Docs 0 0 0 0
Tests 0 0 0 0
Simplification 0 0 0 0

Review Highlights

Codex Session Completer (src/app/v1/_lib/codex/session-completer.ts):

  • Proper error handling with fallback to UUID v7 when Redis is unavailable
  • Race condition handling with NX flag and re-read pattern
  • Comprehensive test coverage (414 lines of tests)

AsyncTaskManager Edge Runtime Fix (src/lib/async-task-manager.ts):

  • Lazy initialization pattern correctly defers Node.js APIs
  • Environment detection properly skips initialization in Edge/CI/build contexts
  • 308 lines of dedicated Edge Runtime tests

Cloud Price Updater (src/lib/price-sync/cloud-price-updater.ts):

  • Dynamic import pattern prevents static bundling issues
  • Proper scheduling flag prevents concurrent trigger race conditions
  • Error handling with logging for scheduling failures

Thinking Signature Rectifier (src/app/v1/_lib/proxy/thinking-signature-rectifier.ts):

  • Extended detection for "signature: Field required" error pattern
  • Reuses existing trigger type for consistent rectification logic
  • New error rule (priority 72) with user-friendly message

Model Multi-Select Fix (src/app/[locale]/settings/providers/_components/model-multi-select.tsx):

  • Correctly merges availableModels + selectedModels for display
  • Ensures custom whitelisted models can be deselected

Review Coverage

  • Logic and correctness - Clean
  • Security (OWASP Top 10) - Clean
  • Error handling - Comprehensive with proper logging
  • Type safety - Clean, no any abuse
  • Documentation accuracy - Comments match code behavior
  • Test coverage - Adequate (new features have dedicated tests)
  • Code clarity - Good

Standards Compliance

  • No emoji in code (CLAUDE.md Rule 1)
  • i18n for user-facing strings (CLAUDE.md Rule 3)
  • Database migrations follow workflow (CLAUDE.md)

Automated review by Claude AI

@@ -735,6 +735,27 @@ const DEFAULT_ERROR_RULES = [
},
},
},
// Issue #xxx: Missing signature field in thinking block
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MEDIUM] [COMMENT-INCOMPLETE] Placeholder issue reference left in DEFAULT_ERROR_RULES

Why this is a problem: The comment uses a placeholder (Issue #xxx) which isn’t a real reference and will drift immediately, making future debugging/auditing harder.

Suggested fix:

// Missing signature field in thinking block (cross-channel format incompatibility)

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

This is a release-sized PR with an extremely broad surface area (332 files / 31,926 LOC changed), spanning proxy/session behavior, system settings, price sync, and a large i18n/messages update. The breadth materially increases regression risk and makes it hard to validate interactions within a single review.

PR Size: XL

  • Lines changed: 31926
  • Files changed: 332
  • Split suggestions:
    • Extract i18n/messages + docs-only changes into a dedicated PR.
    • Extract Codex session-id completion (session completer + session guard + system setting + tests) into a focused PR.
    • Extract async task manager + cloud price sync changes (and related tests) into a separate PR.
    • Extract thinking-signature rectifier + error-rules updates into their own PR.
    • Extract provider-group length change (schema/migrations + UI/forms + validation) into a separate PR.

Issues Found

Category Critical High Medium Low
Logic/Bugs 0 0 0 0
Security 0 0 0 0
Error Handling 0 0 0 0
Types 0 0 0 0
Comments/Docs 0 0 1 0
Tests 0 0 0 0
Simplification 0 0 0 0

Critical Issues (Must Fix)

None.

High Priority Issues (Should Fix)

  • src/repository/error-rules.ts:738 [MEDIUM] [COMMENT-INCOMPLETE] Placeholder comment (Issue #xxx) left in production code (Confidence: 90). Replace with a real issue reference or remove.

Review Coverage

  • Logic and correctness
  • Security (OWASP Top 10)
  • Error handling
  • Type safety
  • Documentation accuracy
  • Test coverage
  • Code clarity

Automated review by Codex AI

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Identified the active PR as #600 (devmain) and applied the size/XL label.
  • gh pr diff failed with HTTP 406 because the PR exceeds GitHub’s 300-file diff limit; reviewed via local git diff between baseRefOid=88858848... and headRefOid=464449ec... instead.
  • Posted 1 inline review comment: src/repository/error-rules.ts:738 [MEDIUM] [COMMENT-INCOMPLETE] placeholder Issue #xxx reference (with a concrete replacement suggestion).
  • Submitted the required review summary on the PR (including XL split suggestions and the issue table).

* feat: auto-complete Codex session identifiers

* fix: avoid Codex metadata injection
@github-actions
Copy link
Contributor

🧪 测试结果

测试类型 状态
代码质量
单元测试
集成测试
API 测试

总体结果: ✅ 所有测试通过

@ding113 ding113 merged commit afe36e3 into main Jan 12, 2026
14 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in Claude Code Hub Roadmap Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core area:i18n area:UI enhancement New feature or request size/XL Extra Large PR (> 1000 lines)

Projects

Status: Done

3 participants