Skip to content

feat: refactor health check to allow spaces in SHELLBOT#9

Closed
wincent wants to merge 1 commit intowolffiex:mainfrom
wincent:fix-healthcheck
Closed

feat: refactor health check to allow spaces in SHELLBOT#9
wincent wants to merge 1 commit intowolffiex:mainfrom
wincent:fix-healthcheck

Conversation

@wincent
Copy link
Contributor

@wincent wincent commented Jul 19, 2024

In ef73bd4 we added a support for a command-line argument that can be used to override the default prompt, but actually supplying an arguments means that the old vim.fn.executable check won't work.

The simplest fix is to just split on whitespace and check the first item to see if it's executable. This isn't perfect, because if somebody installed the executable at a path like /My/Path With Spaces/bin/shellbot, then we'd test /My/Path and report a false negative. But for the common case, this is still an improvement.

In ef73bd4 we added a support for
a command-line argument that can be used to override the default
prompt, but actually supplying an arguments means that the old
`vim.fn.executable` check won't work.

The simplest fix is to just split on whitespace and check the first
item to see if it's executable. This isn't perfect, because if
somebody installed the executable at a path like `/My/Path With
Spaces/bin/shellbot`, then we'd test `/My/Path` and report a false
negative. But for the common case, this is still an improvement.
wincent added a commit to wincent/wincent that referenced this pull request Jul 19, 2024
Upstream has made a number of changes, merging in some PRs that I sent
and adding some equivalent functionality. So I rebased the remaining
branches that matter and added some necessary things on top. Overall, I
currently have these PRs open:

- wolffiex/shellbot#7
  ("docs: fix formatting in README"); this is a redo of:
  wolffiex/shellbot#1

- wolffiex/shellbot#8
  ("chore: remove debugging println!"); necessary because upstream added
  a new file-based prompt customization mechanism, but you can't use it
  without removing the debugging statements.

- wolffiex/shellbot#9
  ("feat: refactor health check to allow spaces in SHELLBOT"); necessary
  to keep healthcheck working if you take advantage of the new
  file-based prompt customization.

- wolffiex/shellbot#10
  ("feat: cosmetic tweaks for Neovim"); draft because it would require
  some changes to directory layout to make it complete, and I don't know
  if upstream will be open to that.

I updated the `wincent` branch in my fork to contain all of these, all
on top of latest upstream `main`.

Note that upstream did some renaming ("ChatGPT" → "ChatBot") so I
mirrored that here too.

* aspects/nvim/files/.config/nvim/pack/bundle/opt/shellbot/lua cc3a399...bef7bb5 (40):
  > Merge branch 'cosmetic-tweaks' into wincent
  > Merge branch 'fix-healthcheck' into wincent
  > Merge branch 'remove-debug-statements' into wincent
  > Merge branch 'readme-formatting' into wincent
  > Chatbot rename
  > Transcript error
  > Logging and fixes newlines
  > Add file arg for system prompt
  > Write one line instead of two
  > Print non-sse output to stderr
  > Generate buffer titles
  > Improve error handling
  > Try merge again
  > README update
  > New Anthropic model!
  > Merge pull request #2 from wincent/assistant-typo
  > Merge pull request #4 from wincent/ft
  > Merge pull request #5 from wincent/healthcheck
  > Prompt cleanup
  > Rename
  > Remove ProviderType
  > Simplify
  > Remove some async
  > Cleanup
  > Oops
  > README update
  > cleanup
  > Remove test transcript
  > Both work
  > Builds with anthropic client
  > Refactor sse converter
  > Separate api provider into module
  > Merge pull request #6 from wincent/header-after-interrupt
  < Merge branch 'header-after-interrupt' into wincent
  < Merge branch 'cosmetic-tweaks' into wincent
  < Merge branch 'healthcheck' into wincent
  < Merge branch 'ft' into wincent
  < Merge branch 'custom-prompt' into wincent
  < Merge branch 'assistant-typo' into wincent
  < Merge branch 'readme-formatting' into wincent
@wincent
Copy link
Contributor Author

wincent commented Oct 11, 2024

Superseded by:

@wincent wincent closed this Oct 11, 2024
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

Successfully merging this pull request may close these issues.

1 participant