Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'claude-opus' #82

Open
lsc64 opened this issue Jul 1, 2024 · 4 comments
Open

KeyError: 'claude-opus' #82

lsc64 opened this issue Jul 1, 2024 · 4 comments

Comments

@lsc64
Copy link

lsc64 commented Jul 1, 2024

Originally everything worked but at some point Devon got stuck and wouldn't restart, giving only the following error message (in tui with --debug)

It seems somewhere the model is set to claude-opus but it's expected to be claude-3-5-sonnet (

default_models = {
"gpt4-o": OpenAiModel,
"claude-3-5-sonnet": AnthropicModel,
}
)

Even manually adjusting .devon.config as follows

{
  "modelName": "claude-3-5-sonnet"
}

says it would use sonnet, but still gives the same error

╰─$ devon-tui --debug
Using model name: claude-3-5-sonnet
[...]
KeyError: 'claude-opus'

Traceback

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/routing.py", line 75, in app
    await response(scope, receive, send)
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/responses.py", line 162, in __call__
    await self.background()
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/background.py", line 45, in __call__
    await task()
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/background.py", line 30, in __call__
    await run_in_threadpool(self.func, *self.args, **self.kwargs)
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/starlette/concurrency.py", line 42, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 859, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/devon_agent/session.py", line 328, in run_event_loop
    events = self.step_event(event)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/devon_agent/session.py", line 376, in step_event
    thought, action, output = self.agent.predict(
                              ^^^^^^^^^^^^^^^^^^^
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/devon_agent/agents/conversational_agent.py", line 160, in predict
    self.current_model = self._initialize_model()
                         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dariush/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/devon_agent/agents/conversational_agent.py", line 54, in _initialize_model
    return self.default_models[self.args.model](
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'claude-opus'
@ObjectJosh
Copy link
Contributor

@lsc64 you're right. Looks like somewhere in the tui code it didn't update to 3.5 sonnet. Thanks for raising this issue! In the meantime, let me know if the electron app is working for you

@lsc64
Copy link
Author

lsc64 commented Jul 2, 2024

@lsc64 you're right. Looks like somewhere in the tui code it didn't update to 3.5 sonnet. Thanks for raising this issue! In the meantime, let me know if the electron app is working for you

It’s the same for the GUI (electron), I just used the TUI for debugging. (Does —debug work with GUI?)

@ObjectJosh
Copy link
Contributor

@lsc64 Hmm... interesting. Have you tried a clean reinstall of both? Haven't gotten this issue with the electron app yet.

@ObjectJosh
Copy link
Contributor

Meaning, clean install of devon_agent since that's one of the common factors rn

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

No branches or pull requests

2 participants