block / goose

Goose is a developer agent that operates from your command line to help you do the boring stuff.
https://block.github.io/goose/
Apache License 2.0
108 stars 17 forks source link

feat: Add synopisis core loop #166

Closed baxen closed 5 days ago

baxen commented 6 days ago

This uses a combination of a moderator and a new toolkit to implement a modified approach to managing the context goose uses to make changes to a local environment.

michaelneale commented 6 days ago

@baxen does this do .goosehints now - I wasn't sure so hard to know how to compare

michaelneale commented 6 days ago

Doesn't seem to do well with large files:

  File "/Users/micn/Documents/code/goose/packages/exchange/src/exchange/providers/utils.py", line 35, in raise_for_status
    raise httpx.HTTPStatusError(f"{e}\n{response.text}", request=e.request, response=e.response)
httpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://api.openai.com/v1/chat/completions'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400
{
  "error": {
    "message": "Invalid 'messages[1].content': string too long. Expected a string with maximum length 1048576, but got a string with length 36908118 instead.",
    "type": "invalid_request_error",
    "param": "messages[1].content",
    "code": "string_above_max_length"
  }
}

vs current released goose:

image

baxen commented 6 days ago

@baxen does this do .goosehints now - I wasn't sure so hard to know how to compare

Thanks for the reminder!! Added

baxen commented 6 days ago

Doesn't seem to do well with large files:

  File "/Users/micn/Documents/code/goose/packages/exchange/src/exchange/providers/utils.py", line 35, in raise_for_status
    raise httpx.HTTPStatusError(f"{e}\n{response.text}", request=e.request, response=e.response)
httpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://api.openai.com/v1/chat/completions'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400
{
  "error": {
    "message": "Invalid 'messages[1].content': string too long. Expected a string with maximum length 1048576, but got a string with length 36908118 instead.",
    "type": "invalid_request_error",
    "param": "messages[1].content",
    "code": "string_above_max_length"
  }
}

vs current released goose:

image

Yup this does make sense. I added a quick patch - it will work like before and for files beyond the context size limit it will hopefully recover.

image
michaelneale commented 6 days ago

@baxen any idea why it isn't running the tests on this branch? (also I keep getting conflicts - I guess the force push? not usually had this)

michaelneale commented 6 days ago

@baxen thanks seems better now (sorry made a few merge/tweaks to it)

lamchau commented 6 days ago

lgtm! added a couple of comments but works great 👍

edit: just noticed a small ux thing that we should do our help is truncated. probably easier to make a shorter message like run/exit from a text file or something to that effect (otherwise we'll need to tinker with the formatters)

Commands:
  providers          Manage providers
  run                Run a single-pass session with a message from a...