Skip to content
This repository was archived by the owner on Jul 4, 2026. It is now read-only.

Fix startup model race conditions, threaded request handling, and encoding cleanup - #37

Open
pratham-jaiswal wants to merge 5 commits into
techjarves:mainfrom
pratham-jaiswal:fix/model-startup-race-and-empty-model-state
Open

Fix startup model race conditions, threaded request handling, and encoding cleanup#37
pratham-jaiswal wants to merge 5 commits into
techjarves:mainfrom
pratham-jaiswal:fix/model-startup-race-and-empty-model-state

Conversation

@pratham-jaiswal

Copy link
Copy Markdown
Contributor

Summary

This PR fixes intermittent startup/request issues caused by frontend model-state race conditions, improves concurrent streaming stability by enabling threaded HTTP request handling, and cleans up corrupted UTF-8 encoding artifacts found in various code/UI strings.


What changed

Frontend / model-state handling

  • prevent sending requests before engine/model state is fully ready
  • disable send actions while models are still loading
  • avoid propagating empty model values into requests/conversations
  • improve frontend model initialization flow
  • add handling for invalid or unloaded model state

Server / streaming behavior

  • switch server to threaded HTTP handling using ThreadingMixIn
  • enable daemon request threads for cleaner shutdown behavior
  • improve concurrent streaming/request isolation

Cleanup

  • remove corrupted UTF-8/encoding artifacts from code

Why

The frontend could become interactive before model initialization had fully settled, especially during slower engine/model loading scenarios. This occasionally allowed empty/invalid model values to propagate into requests.

The threaded HTTP server change improves handling of concurrent streaming requests and avoids situations where request handling/shutdown behavior could become blocked by lingering connections.

The encoding cleanup removes corrupted characters that appeared due to UTF-8/terminal encoding mismatches.


Request for owner verification

Please verify behavior on:

  • macOS
  • Linux
  • Android
  • Windows (final confirmation pass)

- prevent sending messages before engine/model state is ready
- disable send actions while models are still loading
- avoid propagating empty model values into requests/conversations
- improve frontend model initialization flow
- add handling of invalid or unloaded model state
- switch server to threaded HTTP handling for safer concurrent streaming
- enable daemon request threads for cleaner shutdown behavior
@pratham-jaiswal pratham-jaiswal mentioned this pull request May 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant