New#2
Open
Ironboxplus wants to merge 1036 commits into
Open
Conversation
dae9fcf to
c55780c
Compare
1c05e6a to
08e2429
Compare
82e53c6 to
982b813
Compare
f53e4cc to
ab55e95
Compare
2293a13 to
06dff20
Compare
ed8b239 to
4888395
Compare
9582f7c to
6b7618e
Compare
fix(tests): update test cases
Three changes to avoid Anthropic's content-based system prompt validation: 1. Fix identity prefix: Use 'You are Claude Code, Anthropic's official CLI for Claude.' instead of the SDK agent prefix, matching real Claude Code. 2. Move user system instructions to user message: Only keep billing header + identity prefix in system[] array. User system instructions are prepended to the first user message as <system-reminder> blocks. 3. Enable cch signing for OAuth tokens by default: The xxHash64 cch integrity check was previously gated behind experimentalCCHSigning config flag. Now automatically enabled when using OAuth tokens. Related: router-for-me#2599
…mplify session affinity logic
fix(executor): ignore null OpenAI stream usage chunks
fix: apply default auth-dir when config value is empty
- Updated `FileTokenStore` and related stores (`objectstore`, `gitstore`, `postgresstore`) to include the `disabled` flag in metadata for token storage. - Adjusted `Auth` metadata handling to initialize empty maps when absent. - Refined logic in `auto_refresh_loop` and `conductor` to exclude `disabled` tokens from refresh checks. - Added comprehensive unit tests to verify proper handling of the `disabled` flag in storage and retrieval operations.
…dling - Updated `EnsureIndex` logic to incorporate absolute and cleaned file paths when generating auth indexes. - Refined metadata handling to include OAuth type in auth index seed. - Improved compatibility for `json` file paths as sources in auth attributes. - Added unit tests to validate correct auth index behavior for various path and type scenarios.
…s-tool-output-context Fix Responses WebSocket tool output context repair
- Introduced `SetHomeEnabled` to enable/disable request-log forwarding to the home control plane. - Implemented `forwardRequestLogToHome` for non-streaming logs and `homeStreamingLogWriter` for real-time streaming logs. - Enhanced `FileRequestLogger` to bypass local logging when home forwarding is enabled. - Updated server configuration to dynamically toggle home request-log forwarding based on changes. - Added corresponding unit tests to ensure correct forwarding behavior and fallback mechanisms.
…ble usage statistics - Added `count` attribute to `homeAuthCount` requests to improve home message batching. - Enabled usage statistics for home mode by default and added config-level enforcement. - Adjusted failure logging to include detailed metadata in `UsageReporter`. - Updated multiple executors to pass error details to `PublishFailure` for better debugging. - Enhanced unit tests to validate `count` behavior and usage statistics enforcement across components.
…ve error handling in home mode - Introduced `shouldReturnLastErrorOnPickFailure` to streamline error return logic during provider selection. - Added `isHomeRequestRetryExceededError` for better home-specific error classification. - Updated fallback conditions to enhance error handling clarity in `pickNextMixed`.
Move per-connection protocol detection (TLS handshake, reader.Peek) out of the accept loop and into a per-connection goroutine. An idle TCP connection that never sends bytes would previously block Peek(1) indefinitely, preventing all subsequent connections from being accepted and making the management/API server unresponsive. Closes router-for-me#3267
…upport - Introduced `homeRuntimeAuths` to cache home auths for websocket session reuse. - Updated `pickNextViaHome` to prioritize cached auths for pinned websocket sessions. - Implemented automatic clearing of cached home auths when home mode is disabled. - Added unit tests to validate caching behavior, clearing logic, and fallback scenarios.
…ef counting - Added `homeRuntimeAuthSessions` and `homeRuntimeAuthRefs` for scoped caching of home auths per session. - Updated `pickNextViaHome` to prevent reuse of already-tried pinned auths during session retries. - Implemented reference counting for shared auths across multiple sessions to improve memory management. - Enhanced session cleanup logic to clear cached auths only when all referencing sessions are closed. - Added unit tests to validate scoped caching, retry logic, and session cleanup behavior.
…counting - Consolidated `homeRuntimeAuths` to store a map of session-scoped auth maps, replacing `homeRuntimeAuthSessions` and `homeRuntimeAuthRefs`. - Adjusted session cleanup logic to directly remove session-scoped auths without reference counting. - Added `GetExecutionSessionAuthByID` to retrieve auths scoped to a specific execution session. - Updated tests to reflect the new session-scoped caching behavior.
- Introduced `logHomeConfigChanges` to compare old and new configs, logging detected differences. - Leveraged `diff.BuildConfigChangeDetails` for structured change detection. - Adjusted logging behavior to enable debug-level logs dynamically when required.
Clear the 10s read deadline before calling handleRedisConnection so that authenticated Redis clients are not disconnected by an i/o timeout after 10 seconds of idle time. HTTP paths already clear the deadline after routing. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fix(api): prevent idle TCP connections from blocking the accept loop
- Introduced `CacheReadTokens` and `CacheCreationTokens` to enhance token breakdown. - Refactored `parseClaudeUsageNode` for cleaner and reusable logic. - Adjusted helpers and updated token calculations to align with the new fields.
…refresh - Added `isUnauthorizedError` and `hasUnauthorizedAuthFailure` to classify and handle unauthorized errors. - Introduced `refreshErrorFromError` to map errors to standardized unauthorized responses. - Modified refresh logic to stop auto-refresh retries for unauthorized errors. - Updated tests to verify unauthorized error handling and refresh retry prevention.
…ling - Introduced cluster node management with `clusterNode` and `clusterNodesEnvelope` types. - Added failover handling for reconnection failures with configurable threshold (`homeReconnectFailoverThreshold`). - Implemented node switching and dynamic cluster target updates. - Enhanced Redis client management with centralized locking for concurrency safety. - Updated configuration refresh logic to prioritize the best cluster node. - Improved debug logging for reconnect failures and node switching.
- Introduced `geminiModelsHandler` to dynamically route Gemini model requests based on home configuration. - Added `handleHomeGeminiModels` and `loadHomeModelEntries` to support home-specific Gemini model handling. - Refactored and centralized error handling logic for improved maintainability. - Enhanced response formatting with `formatHomeGeminiModels` for consistent output structure.
- Remove the early return in GetRequestErrorLogs that returned empty when RequestLog was enabled. Error log files are now always listed regardless of the RequestLog setting. - Refactor logRequest to always write error-*.log files for failed requests (status >= 400), even when full request logging is enabled. Previously error logs were only written when RequestLog was disabled. - Fix Claude usage reporting: when input_tokens < cache_read_input_tokens, add cached tokens to input tokens so the displayed total is accurate (e.g. "I 167.5K" instead of misleading "I 3"). - Add 4 tests covering Claude usage cache inclusion scenarios.
- Add publish.yml for GHCR Docker image builds - Add workflow_dispatch to docker-image.yml and release.yaml - Use secrets-based DOCKERHUB_REPO for docker-image.yml - Remove upstream-only agents-md-guard and auto-retarget workflows
GetRequestErrorLogs previously only listed error-*.log files and returned empty when request-log was enabled. Now it lists ALL request log files (v1-messages-*.log, error-*.log, etc.) when request-log is on, and only error-*.log when it's off. Also fix writeErrorLog condition to trigger on any status >= 400 regardless of the force flag.
parseClaudeUsageNode previously dropped cache_creation_input_tokens whenever cache_read_input_tokens > 0, causing CachedTokens, InputTokens and TotalTokens to be under-reported when both cache fields were present. Sum both cache fields into the cached total and use that sum for both the CachedTokens field and the heuristic that decides whether input_tokens already aggregates the cached portion.
- env.md: local/remote environment record - journal.md: progress journal - plan.md: immutable plan reference - .gitignore: ignore .omc/.omx/scripts local tooling directories
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.
No description provided.