Skip to content

Codex mini - #34

Merged
adamdotdevin merged 3 commits into
anomalyco:devfrom
PhantomReactor:codex-mini
May 18, 2025
Merged

adamdotdevin merged 3 commits into
anomalyco:devfrom
PhantomReactor:codex-mini

Conversation

@PhantomReactor

@PhantomReactor PhantomReactor commented May 18, 2025 •

Copy link
Copy Markdown
Contributor

Closes #27

@adamdotdevin
adamdotdevin merged commit 2f8984f into anomalyco:dev May 18, 2025
@adamdotdevin

Copy link
Copy Markdown
Member

nice lol

randomm referenced this pull request in randomm/opencode Jan 9, 2026
…#34)

Previous patterns used incorrect glob syntax that didn't match
AWS CLI command format:
- Wrong: aws */describe* (expected slash)
- Wrong: aws *:create* (expected colon)
- Actual AWS CLI: aws ec2 describe-instances (space-separated)

Fixed all 30+ patterns to use correct format:
- Correct: aws * describe* (space wildcard space action)
- Matches: aws <service> <action> format

Changes applied to both personal and work configs.
Enables research-specialist to actually query AWS services.
"github.com/openai/openai-go/shared"
"github.com/sst/opencode/internal/config"
"github.com/sst/opencode/internal/status"
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion (import ordering): Standard library imports should come first, then external packages, then internal packages. Consider reordering imports like this:

import (
    "context"
    "encoding/json"
    "errors"
    "fmt"
    "io"
    "log/slog"
    "time"

    "github.com/openai/openai-go"
    "github.com/openai/openai-go/responses"
    "github.com/openai/openai-go/shared"

    "github.com/sst/opencode/internal/config"
    "github.com/sst/opencode/internal/llm/models"
    "github.com/sst/opencode/internal/llm/tools"
    "github.com/sst/opencode/internal/message"
    "github.com/sst/opencode/internal/status"
)

This is a minor suggestion for consistency with the style guide.

Messages: messages,
Tools: tools,
}
if o.providerOptions.model.CanReason == true {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion (style): Using == true is redundant in Go. Consider simplifying to just if o.providerOptions.model.CanReason {. This is a minor nitpick for Go idiomatic style.


params.MaxOutputTokens = openai.Int(o.providerOptions.maxTokens)

if o.providerOptions.model.CanReason == true {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion (style): Same here - using == true is redundant in Go. Consider simplifying to just if o.providerOptions.model.CanReason {.


return outputTools
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion (formatting): There are multiple consecutive blank lines here. Running go fmt should fix this - standard Go formatting uses single blank lines for separation.

@rootxharsh

Copy link
Copy Markdown

Code Review Summary

I've reviewed the PR changes (note: the actual changes are related to OpenAI provider refactoring and adding Codex Mini support, not TUI rendering as mentioned in the description).

Minor Suggestions (all optional):

  1. Import ordering in openai_response.go - Standard library imports should come first, then external packages, then internal packages per the style guide.

  2. Boolean comparison style - Using == true is redundant in Go. Found in:

    • openai_completion.go:108
    • openai_response.go:135
  3. Formatting - Multiple consecutive blank lines in a few places. Running go fmt should clean these up.

Overall

The code logic looks solid. The refactoring to split chat completion and response APIs into separate files is a good approach for maintainability. The new Codex Mini model integration follows the existing patterns well.

These are all minor suggestions - feel free to address them or leave as-is based on your preference.

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.

codex-mini, openai responses api

3 participants