Closed GregoMac1 closed 3 weeks ago
@GregoMac1 also, a test should have caught this bug when I switched to ollama-js
.
I think we have a test for the "Stop" behavior pero I don't know if it's specifically testing the abortController
behavior, can you see if we can improve the coverage?
Latest commit: |
bfb6e58
|
Status: | ✅ Deploy successful! |
Preview URL: | https://1baa3594.hollama.pages.dev |
Branch Preview URL: | https://126-output-from-multiple-ses.hollama.pages.dev |
I found a bug when you stop an ongoing 'completion' and then click on another link, it asks if you are sure about leaving.
https://github.com/user-attachments/assets/a452738f-2dfa-49a8-8987-6040b3ee3c38
@fmaclen the code is ready!
About the test, I initially didn't know how to emulate the behavior of the 'pending' requests, so I asked Claude for help and I ended up with this test case.
As far as I understand, it should work, but it doesn't. It fails because, at line 609, it expects the completion to be started, but it is not. I think it has to be something about the stream response emulated at line 591.
Do you see something wrong?
I've changed the code and I've split the tests but I still could not make them work. I'll dig deeper tomorrow.
I've split the tests but I still could not make them work
There's a few issues with the tests:
can navigate away from session while a response is in progress
looks incomplete to me, somewhere there we should be "accepting" the confirmation dialog.can start a new session, choose a model and stop a completion in progress
is now failing, we can probably move the stop response
UI assertions from that test into one of the new ones.main
to fix the test seed data and take screenshots for README.md
.The rest of the implementation looks good 👍
Thanks for the feedback!
- The shape of the streamed mocked responses should match the Ollama API
About this, I followed the shape of the real responses from Ollama in the app, which look like this:
Instead of response
, the replies contain message: { role: string, content: string }
.
I'm still working on the rest of tests!
Instead of response, the replies contain message:
{ role: string, content: string }
.
Sorry, you are right. I was looking at the /api/generate
streamed response instead of /api/chat
. My bad!
@GregoMac1 I updated this PR with the latest merges on main
and fixed the conflicts:
https://github.com/fmaclen/hollama/pull/156
https://github.com/fmaclen/hollama/pull/157
:tada: This PR is included in version 0.10.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket: