fix(haivemind): start engine after MainScreen mounts
Some checks failed
CI / check (push) Has been cancelled
Some checks failed
CI / check (push) Has been cancelled
This commit is contained in:
28
packages/haivemind/fix-chat-log-race.patch
Normal file
28
packages/haivemind/fix-chat-log-race.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
--- a/haivemind_tui.py
|
||||
+++ b/haivemind_tui.py
|
||||
@@ -1195,6 +1195,14 @@
|
||||
yield TheatrePanel(id="theatre-container")
|
||||
yield Footer()
|
||||
|
||||
+ def on_mount(self) -> None:
|
||||
+ app = self.app
|
||||
+ if (
|
||||
+ getattr(app, "_prompt", None) is not None
|
||||
+ and getattr(app, "_config", None) is not None
|
||||
+ ):
|
||||
+ app.start_run(app._prompt, app._config)
|
||||
+
|
||||
|
||||
class HaivemindApp(App):
|
||||
CSS = CSS
|
||||
@@ -1224,9 +1232,7 @@
|
||||
def on_mount(self) -> None:
|
||||
self.push_screen(MainScreen())
|
||||
self.set_interval(0.15, self._tick_spinner)
|
||||
- if self._prompt is not None and self._config is not None:
|
||||
- self.start_run(self._prompt, self._config)
|
||||
- else:
|
||||
+ if self._prompt is None or self._config is None:
|
||||
self.push_screen(ConfigScreen())
|
||||
|
||||
def start_run(self, prompt: str, config: HaivemindConfig) -> None:
|
||||
@@ -24,6 +24,8 @@ python3Packages.buildPythonApplication rec {
|
||||
textual
|
||||
];
|
||||
|
||||
patches = [ ./fix-chat-log-race.patch ];
|
||||
|
||||
doCheck = false;
|
||||
pythonImportsCheck = [
|
||||
"haivemind"
|
||||
|
||||
Reference in New Issue
Block a user