Repository navigation
refactor(backend): remove placeholders left by removed features - #242
Merged
Merged
Conversation
HTExplicit
force-pushed
the
refactor/drop-placeholder-context
branch
from
October 4, 2026 10:54
22564bb to
14769e5
Compare
resolveOpenAIForwardModelContext only returned resolveOpenAIForwardModel with a nil error, so its 14 callers each carried an error branch that could never run. isOpenAIAccountRuntimeBlockedContext held the body of isOpenAIAccountRuntimeBlocked behind an unused context. Both came from Cindy features that have since been removed. Callers now use the upstream line where upstream has the same call, and the fork's line from before the Cindy commits elsewhere. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-up to the two placeholder-context functions: the same Cindy, plugin-host and overdraft commits left more of the same kind. Billing (openai_gateway_usage.go) is back to upstream's shape: no unused account/tokens parameters, no error return that was nil on every path, no duplicated channel-pricing branch. Result structs lose fields that were only written or never assigned. Runtime-block code loses a condition that was always false and a fallback no caller could reach. Functions with no production caller go with their tests. Blank parameters whose reason is gone are dropped from their signatures; wire_gen.go is regenerated. Kept on purpose: blank parameters required by an interface, a callback or wire ordering, and signatures kept identical to upstream. No request changes what it sends, bills or fails on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HTExplicit
force-pushed
the
refactor/drop-placeholder-context
branch
from
October 4, 2026 11:39
14769e5 to
b6f09a4
Compare
HTExplicit
enabled auto-merge (squash)
October 4, 2026 11:39
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.
Problem
Features that were removed from the fork (Cindy, the plugin host, quota overdraft) left placeholders in the backend: unused parameters, error returns that are nil on every path, conditions that are always false, fields that are only written or never assigned, and functions with no production caller. The owner's rule is that a retired feature leaves nothing behind.
Change
Each item was judged by the commit that introduced it. It is restored to the upstream v0.2.13 form where upstream has the same function, and to the fork's form from before the feature elsewhere.
Two placeholder-context functions (first commit)
resolveOpenAIForwardModelContextonly returnedresolveOpenAIForwardModelwith a nil error. Its 14 callers lose an error branch that could never run. Nine now match upstream byte for byte; five are fork-only lines restored to their pre-Cindy form.isOpenAIAccountRuntimeBlockedContextheld the body ofisOpenAIAccountRuntimeBlockedbehind an unused context. One function remains.The same kind, found by review (second commit)
openai_gateway_usage.go), back to upstream's shape:account/tokensparameters;calculateOpenAIImageCostreturns the cost only, since its error was nil on all five paths;CacheCreation5mTokens,CacheCreation1hTokens,UsageInputTokensExcludeCache) or only written (ImageInputCount) are removed.wire_gen.gois regenerated with wire v0.7.0.Kept on purpose
No request changes what it sends, bills or fails on.
Verification
go build ./...(default andGOOS=linux);go vet ./...with no tag and with-tags unit;go vet -tags integrationon repository, service and handler;wire diffclean;Not run locally: golangci-lint (the local binary cannot read Go 1.27 export data; CI runs it), full suites, real model calls.
🤖 Generated with Claude Code