Repository navigation
Conversation
WalkthroughTwo distinct changes: GitHub Actions workflow updated to enable manual triggers and replace Docker repository reference from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
dto/error.go (1)
42-48: Apply the same branding normalization inToMessageto avoid inconsistent output.
Right now, Line 47 normalizes only inTryToOpenAIError. Callers usingToMessagewill still see “Anthropic,” which undermines the change’s intent.Suggested fix
func (e GeneralErrorResponse) TryToOpenAIError() *types.OpenAIError { var openAIError types.OpenAIError if len(e.Error) > 0 { err := common.Unmarshal(e.Error, &openAIError) if err == nil && openAIError.Message != "" { - openAIError.Message = strings.ReplaceAll(openAIError.Message, "Anthropic", "KernelCat") + openAIError.Message = normalizeErrorMessage(openAIError.Message) return &openAIError } } return nil } +func normalizeErrorMessage(msg string) string { + return strings.ReplaceAll(msg, "Anthropic", "KernelCat") +} + func (e GeneralErrorResponse) ToMessage() string { if len(e.Error) > 0 { switch common.GetJsonType(e.Error) { case "object": var openAIError types.OpenAIError err := common.Unmarshal(e.Error, &openAIError) if err == nil && openAIError.Message != "" { - return openAIError.Message + return normalizeErrorMessage(openAIError.Message) }Also applies to: 54-62
.github/workflows/docker-image-arm64.yml (1)
3-40: Guardworkflow_dispatchso it doesn’t push invalid tags.
On manual runs from a branch, Line 37 will setTAGtorefs/heads/..., which includes/and can break Docker tag pushes. Also, manifests won’t run due to the tag-onlyifcondition.Suggested fix
on: workflow_dispatch: + inputs: + tag: + description: "Release tag to publish (e.g., v1.2.3)" + required: true + type: string push: tags: - '*' @@ - name: Resolve tag & write VERSION run: | git fetch --tags --force --depth=1 - TAG=${GITHUB_REF#refs/tags/} + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + TAG="${{ inputs.tag }}" + else + TAG="${GITHUB_REF#refs/tags/}" + fi + if [[ -z "$TAG" || "$TAG" == *"/"* ]]; then + echo "Invalid TAG: $TAG" + exit 1 + fi echo "TAG=$TAG" >> $GITHUB_ENV echo "$TAG" > VERSION echo "Building tag: $TAG for ${{ matrix.arch }}" @@ - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' steps: - name: Extract tag - run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + run: | + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "TAG=${{ inputs.tag }}" >> $GITHUB_ENV + else + echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + fiAlso applies to: 91-95
Summary by CodeRabbit
Chores
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.