Skip to content

crash issue #577

@epheien

Description

@epheien

crush + lmdeploy + gpt-oss

(~) ➜  MacBookPro.local 12-16 02:44:00.170 crush git:(main) $ crush       
goroutine 178 [running]:
runtime/debug.Stack()
        /opt/homebrew/Cellar/go/1.25.1/libexec/src/runtime/debug/stack.go:26 +0x64
charm.land/bubbletea/v2.(*Program).recoverFromGoPanic(0x14005f62000, {0x1048b3720, 0x14005bce0a8})
        /Users/eph/go/pkg/mod/charm.land/bubbletea/v2@v2.0.0-rc.2.0.20251202162339-5fa38b798f16/tea.go:1260 +0xf0
charm.land/bubbletea/v2.(*Program).execBatchMsg.func2.1()
        /Users/eph/go/pkg/mod/charm.land/bubbletea/v2@v2.0.0-rc.2.0.20251202162339-5fa38b798f16/tea.go:913 +0x40
panic({0x1048b3720?, 0x14005bce0a8?})
        /opt/homebrew/Cellar/go/1.25.1/libexec/src/runtime/panic.go:783 +0x120
github.com/openai/openai-go/v2.(*chatCompletionResponseState).update(_, {{0x1400080a127, 0x1}, {0x14005aba288, 0x1, 0x1}, 0x6940b6ba, {0x1400080a169, 0xc}, {0x1400080a134,
 ...}, ...})
        /Users/eph/go/pkg/mod/github.com/openai/openai-go/v2@v2.7.1/streamaccumulator.go:172 +0xec
github.com/openai/openai-go/v2.(*ChatCompletionAccumulator).AddChunk(_, {{0x1400080a127, 0x1}, {0x14005aba288, 0x1, 0x1}, 0x6940b6ba, {0x1400080a169, 0xc}, {0x1400080a134,
 ...}, ...})
        /Users/eph/go/pkg/mod/github.com/openai/openai-go/v2@v2.7.1/streamaccumulator.go:51 +0x108
charm.land/fantasy/providers/openai.languageModel.Stream.func1(0x140000a8f00)
        /Users/eph/go/pkg/mod/charm.land/fantasy@v0.5.1/providers/openai/language_model.go:339 +0x188
charm.land/fantasy.(*agent).processStepStream(_, {_, _}, _, {{0x14005bf1e78, 0x5}, {0x0, 0x0, 0x0}, {0x0, ...}, ...}, ...)
        /Users/eph/go/pkg/mod/charm.land/fantasy@v0.5.1/agent.go:1166 +0x4c4
charm.land/fantasy.(*agent).Stream.func1()
        /Users/eph/go/pkg/mod/charm.land/fantasy@v0.5.1/agent.go:849 +0x10c
charm.land/fantasy.retryWithExponentialBackoff[...]({0x104a785b0, 0x140001cc930}, 0x1400128cc68, {0x14000271720, 0x0?, 0x14005bf1e78?, 0x104a447d8?}, {0x0?, 0x0, 0x0})
        /Users/eph/go/pkg/mod/charm.land/fantasy@v0.5.1/retry.go:92 +0xb0
charm.land/fantasy.(*agent).Stream.RetryWithExponentialBackoffRespectingRetryHeaders[...].func2(...)
        /Users/eph/go/pkg/mod/charm.land/fantasy@v0.5.1/retry.go:64
charm.land/fantasy.(*agent).Stream(_, {_, _}, {{0x14005bf1e78, 0x5}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...})
        /Users/eph/go/pkg/mod/charm.land/fantasy@v0.5.1/agent.go:841 +0x7fc
github.com/charmbracelet/crush/internal/agent.(*sessionAgent).Run(0x14005a8e908, {0x104a783a0, 0x105cfacc0}, {{0x140012f0300, 0x24}, {0x14005bf1e78, 0x5}, 0x140001e1530, {
0x0, 0x0, ...}, ...})
        /Users/eph/wsp/crush/internal/agent/agent.go:197 +0xcf0
github.com/charmbracelet/crush/internal/agent.(*coordinator).Run(0x140057f0630, {0x104a783a0, 0x105cfacc0}, {0x140012f0300, 0x24}, {0x14005bf1e78, 0x5}, {0x0, 0x0, 0x0})
        /Users/eph/wsp/crush/internal/agent/coordinator.go:146 +0x504
github.com/charmbracelet/crush/internal/tui/page/chat.(*chatPage).sendMessage.func1()
        /Users/eph/wsp/crush/internal/tui/page/chat/chat.go:775 +0x50
charm.land/bubbletea/v2.(*Program).execBatchMsg.func2()
        /Users/eph/go/pkg/mod/charm.land/bubbletea/v2@v2.0.0-rc.2.0.20251202162339-5fa38b798f16/tea.go:918 +0x88
created by charm.land/bubbletea/v2.(*Program).execBatchMsg in goroutine 64
        /Users/eph/go/pkg/mod/charm.land/bubbletea/v2@v2.0.0-rc.2.0.20251202162339-5fa38b798f16/tea.go:907 +0xf0

          
   ERROR  
          
  Crush crashed. If metrics are enabled, we were notified about it. If you'd like to report it, please copy the       
  stacktrace above and open an issue at https://github.com/charmbracelet/crush/issues/new?template=bug.yml.           

TLDR

#L172

Here, there was no check for the length of the tool calls array, leading to a crash.

v2 and v3 both have this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions