fix(tests): correct errors.Is argument order and revert unrelated rename

- Fix reversed arguments in errors.Is calls in tests
- Revert cp -> copy rename in codex_provider.go to keep PR focused
This commit is contained in:
Ruslan Semagin 2026-02-19 16:18:25 +03:00
parent 4e68cf5b1e
commit 9929003f69
3 changed files with 4 additions and 4 deletions

View file

@ -91,8 +91,8 @@ func (p *CodexProvider) Chat(ctx context.Context, messages []Message, tools []To
if evt.Type == "response.completed" || evt.Type == "response.failed" || evt.Type == "response.incomplete" {
evtResp := evt.Response
if evtResp.ID != "" {
cp := evtResp
resp = &cp
copy := evtResp
resp = &copy
}
}
}

View file

@ -293,7 +293,7 @@ func TestFailoverError_ErrorString(t *testing.T) {
func TestFailoverError_Unwrap(t *testing.T) {
inner := errors.New("inner error")
fe := &FailoverError{Reason: FailoverTimeout, Wrapped: inner}
if !errors.Is(inner, fe.Unwrap()) {
if !errors.Is(fe.Unwrap(), inner) {
t.Error("Unwrap should return wrapped error")
}
}

View file

@ -126,7 +126,7 @@ func TestMessageTool_Execute_SendFailure(t *testing.T) {
if result.Err == nil {
t.Error("Expected Err to be set")
}
if !errors.Is(sendErr, result.Err) {
if !errors.Is(result.Err, sendErr) {
t.Errorf("Expected Err to be sendErr, got %v", result.Err)
}
}