Skip to content

1.0 - #2747

Closed
ahmczsy wants to merge 4 commits into
QuantumNous:mainfrom
autokernel-sz:1.0
Closed

1.0#2747
ahmczsy wants to merge 4 commits into
QuantumNous:mainfrom
autokernel-sz:1.0

Conversation

@ahmczsy

@ahmczsy ahmczsy commented Jan 25, 2026 •

Copy link
Copy Markdown

Summary by CodeRabbit

  • Chores

    • Updated Docker image repository reference
  • Bug Fixes

    • Updated error message text for consistency

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 25, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Two distinct changes: GitHub Actions workflow updated to enable manual triggers and replace Docker repository reference from calciumion/new-api to ahmczsy/new-api. Error handling module modified to replace "Anthropic" text with "KernelCat" in error messages during OpenAI error processing.

Changes

Cohort / File(s) Summary
CI/CD Configuration
.github/workflows/docker-image-arm64.yml
Added workflow_dispatch trigger for manual execution; replaced Docker Hub repository references from calciumion/new-api to ahmczsy/new-api across metadata extraction, build-push tags, and manifest creation steps; GHCR sections remain commented out.
Error Handling
dto/error.go
Added strings import; modified TryToOpenAIError method to replace all occurrences of "Anthropic" with "KernelCat" in error messages before returning.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • ignore ghcr #2022: Modifies the same Docker workflow file, adjusting Docker publishing steps and enabling/disabling specific registry sections.
  • feat: matrix ci #2008: Updates the same GitHub Actions workflow with Docker image repository references and manifest/tag creation modifications.
  • feat: matrix ci #2014: Alters the same CI workflow, restructuring build/manifest creation and push steps into a matrix configuration.

Poem

🐰 A Docker image hops to a new home,
From calciumion's den to ahmczsy's zone,
While errors swap Anthropic for KernelCat's name,
The workflows now dance at the push of a frame! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title '1.0' is vague and does not clearly convey what changes are being made; it appears to be a version number rather than a descriptive summary of the pull request's purpose or changes. Replace the title with a clear, descriptive summary of the main changes, such as 'Update Docker workflow repository and add message sanitization for Anthropic errors' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in ToMessage to avoid inconsistent output.
Right now, Line 47 normalizes only in TryToOpenAIError. Callers using ToMessage will 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: Guard workflow_dispatch so it doesn’t push invalid tags.
On manual runs from a branch, Line 37 will set TAG to refs/heads/..., which includes / and can break Docker tag pushes. Also, manifests won’t run due to the tag-only if condition.

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
+          fi

Also applies to: 91-95

@seefs001 seefs001 closed this Jan 25, 2026
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.

2 participants