block-open-source / goose

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

Issues using github toolkit #65

Open Kvadratni opened 2 weeks ago

Kvadratni commented 2 weeks ago

when running goose with a profile that uses github toolkit if local repo is not associated with github yet - I get an exception

sq goose session start --profile money
Traceback (most recent call last):
  File "/opt/homebrew/etc/sqbin/goose", line 8, in <module>
    sys.exit(cli())
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/goose/cli/main.py", line 77, in session_start
    session = Session(profile=profile, plan=_plan)
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/goose/cli/session.py", line 99, in __init__
    self.exchange = build_exchange(profile=load_profile(profile), notifier=self.notifier)
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/goose/build.py", line 50, in build_exchange
    system = "\n\n".join([Message.load("system.jinja").text] + [toolkit.system() for toolkit in toolkits])
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/goose/build.py", line 50, in <listcomp>
    system = "\n\n".join([Message.load("system.jinja").text] + [toolkit.system() for toolkit in toolkits])
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/goose_plugins_block/toolkits/language.py", line 15, in system
    git_remote_url = get_git_remote_url(Path.cwd())
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/goose_plugins_block/utils/git_utils.py", line 10, in get_git_remote_url
    return repo.remote(name="origin").url
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/git/repo/base.py", line 460, in remote
    raise ValueError("Remote named '%s' didn't exist" % name)
ValueError: Remote named 'origin' didn't exist

it also fails when git is not initialized in folder

~/Development/playground sq goose session start --profile money
Not part of a Git repository. Returning current working directory
Traceback (most recent call last):
  File "/opt/homebrew/etc/sqbin/goose", line 8, in <module>
    sys.exit(cli())
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/goose/cli/main.py", line 77, in session_start
    session = Session(profile=profile, plan=_plan)
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/goose/cli/session.py", line 99, in __init__
    self.exchange = build_exchange(profile=load_profile(profile), notifier=self.notifier)
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/goose/build.py", line 50, in build_exchange
    system = "\n\n".join([Message.load("system.jinja").text] + [toolkit.system() for toolkit in toolkits])
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/goose/build.py", line 50, in <listcomp>
    system = "\n\n".join([Message.load("system.jinja").text] + [toolkit.system() for toolkit in toolkits])
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/goose_plugins_block/toolkits/language.py", line 15, in system
    git_remote_url = get_git_remote_url(Path.cwd())
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/goose_plugins_block/utils/git_utils.py", line 9, in get_git_remote_url
    repo = Repo(project_root, search_parent_directories=True)
  File "/opt/homebrew/Cellar/block-goose/0.9.1/libexec/lib/python3.10/site-packages/git/repo/base.py", line 289, in __init__
    raise InvalidGitRepositoryError(epath)
git.exc.InvalidGitRepositoryError: /Users/mnovich/Development/playground