feat: pnpm migration, English logs, local temp chat mode - #161
Open
shabahmd wants to merge 4 commits into
Open
Conversation
- Switch package manager from npm to pnpm (v11), add pnpm-workspace.yaml - Add enableTempChats config + local chat_mode support in middleware and request util - Translate all logger/console/throw/res Chinese strings to English across 29 files - Remove PM2, package-lock.json from gitignore; add pnpm-lock.yaml - Build frontend successfully with pnpm Co-authored-by: ByNara <admin@bynara.id> Model: agnes-2.0-flash
- Remove PM2 references, replace npm with pnpm - Add ENABLE_TEMP_CHATS config option documentation - Update project structure (pnpm-workspace.yaml, no ecosystem.config.js) - Clean up stale references Co-authored-by: ByNara <admin@bynara.id> Model: agnes-2.0-flash
Author
|
Well, I prefer my rice boiled, not cooked. |
Author
|
Also, I did not know much about PM2, I can re-add them into a new pull request if server hosting is required. |
…stream payloads - resolveChatMode(): one decision point (explicit 'normal' > 'local'/ENABLE_TEMP_CHATS > default), used by both OpenAI middleware and Anthropic builder - generateChatID creates upstream chats with the resolved chat_mode; /c/local referer in temp mode - buildFeChatMessage(): shared FE 0.2.81 message factory; Anthropic path now sends a full-shape single message (+version/timestamp, -session_id/-id), fixing upstream WAF/captcha rejections (FAIL_SYS_USER_VALIDATE/RGV587) on /v1/messages - parserModel: omitted model now resolves dynamically from the upstream t2t list instead of hardcoded qwen3-coder-plus - ENABLE_TEMP_CHATS documented in env example; npm test uses --test-force-exit - tests: chat_mode precedence, middleware stamping, FE shape guard Co-authored-by: ByNara <admin@bynara.id> Model: agnes-2.0-flash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Package Manager: npm → pnpm
packageManagerfieldpnpm-workspace.yaml(root + public workspace)package-lock.jsonwithpnpm-lock.yamlecosystem.config.js,PM2_INSTANCES,PM2_MAX_MEMORY)Local/Temporary Chat Mode — single source of truth (551dff6)
resolveChatMode()helper (src/utils/chat-helpers.js): the only chat_mode decision point — explicit client'normal'wins over the flag, then'local'request orENABLE_TEMP_CHATS=true, else'normal'buildInternalRequest(previously hardcoded'normal')generateChatID()now creates upstream chats with the resolved mode (chats/newpayload), and both upstream requests use referer/c/localin temp mode — matching real browser trafficENABLE_TEMP_CHATShad no effect: a persistent chat was always created first with hardcoded'normal'Fix Anthropic
/v1/messagesupstream WAF/captcha rejections (551dff6)version/timestamp, skeletal messages, extrasession_id/id) → Alibaba risk control fingerprinted it as a bot → HTTP 200 withFAIL_SYS_USER_VALIDATE / RGV587buildFeChatMessage()factory emits the full FE 0.2.81 message shape; used by both middleware and Anthropic builder (no duplicated message literals)parserMessages),version: '2.1', top-leveltimestamp; removed write-onlysession_id/id/top-levelsub_chat_typeDynamic default model (551dff6)
/v1/modelsderives from the live upstream list (+ capability suffixes); request models are alias-matched against itmodelnow resolves to the first upstreamt2t-capable model instead of literalqwen3-coder-plus(absent from today's list)Chinese → English Log Translation
Files Changed
.env.example: documentsENABLE_TEMP_CHATSTesting
node --test --test-force-exit tests/*.test.js)resolveChatModeprecedence, middleware stamping, FE message-shape guard/v1/chat/completions: no field → local, explicitlocal✓, explicitnormalopt-out ✓/v1/messages: default,local, andnormalall return completions (previously deterministic WAF failure)qwen3.8-max,qwen3.7-max,qwen3.6-pluseach resolve to distinct upstream models; omitted model resolves dynamically