Skip to content

New#2

Open
Ironboxplus wants to merge 1036 commits into
mainfrom
new
Open

New#2
Ironboxplus wants to merge 1036 commits into
mainfrom
new

Conversation

@Ironboxplus
Copy link
Copy Markdown
Owner

No description provided.

@Ironboxplus Ironboxplus force-pushed the new branch 6 times, most recently from dae9fcf to c55780c Compare January 24, 2026 06:39
@Ironboxplus Ironboxplus force-pushed the new branch 3 times, most recently from 1c05e6a to 08e2429 Compare February 10, 2026 14:46
@Ironboxplus Ironboxplus force-pushed the new branch 4 times, most recently from 82e53c6 to 982b813 Compare February 20, 2026 14:38
@Ironboxplus Ironboxplus force-pushed the new branch 2 times, most recently from f53e4cc to ab55e95 Compare March 6, 2026 06:46
@Ironboxplus Ironboxplus force-pushed the new branch 4 times, most recently from 2293a13 to 06dff20 Compare March 14, 2026 05:27
@Ironboxplus Ironboxplus force-pushed the new branch 2 times, most recently from ed8b239 to 4888395 Compare March 23, 2026 14:29
@Ironboxplus Ironboxplus force-pushed the new branch 2 times, most recently from 9582f7c to 6b7618e Compare March 30, 2026 10:48
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
luispater and others added 19 commits May 9, 2026 10:51
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.
luispater and others added 9 commits May 13, 2026 02:59
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.