mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-14 02:29:33 +01:00
fix(local-model): a switch or a new model from a stopped model undoes the Stop
A job started from a model the person had stopped runs the runtime, and the model it ends on is in use and running. The stored "stopped" flag stayed set, so that model would not have started with the server again. Both verbs now set it back once their job started, the way Start does. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
2f17b8067a
commit
7bdef0d86a
4 files changed
+43
-2
No files matched your search
@@ -1955,6 +1955,7 @@ class LocalModelServiceImpl implements LocalModelService {
|
||||
steps: jobSteps({ agentInstalled: harness.installed }),
|
||||
});
|
||||
if (refused) return refused;
|
||||
await this.undoStop();
|
||||
this.forgetStore();
|
||||
void this.deps
|
||||
.audit({
|
||||
@@ -2015,6 +2016,7 @@ class LocalModelServiceImpl implements LocalModelService {
|
||||
cli,
|
||||
});
|
||||
if (refused) return refused;
|
||||
await this.undoStop();
|
||||
this.forgetStore();
|
||||
void this.deps
|
||||
.audit({
|
||||
@@ -2183,6 +2185,19 @@ class LocalModelServiceImpl implements LocalModelService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* A job that starts from a model the person had stopped runs the runtime, and that model is
|
||||
* then in use: the Stop is undone, like Start undoes it, so the runtime starts with the
|
||||
* server again. Without this the model would be running now and stay down after a restart.
|
||||
*/
|
||||
private async undoStop(): Promise<void> {
|
||||
await this.record((current) =>
|
||||
current.runtime && !current.runtime.enabled
|
||||
? { ...current, runtime: { ...current.runtime, enabled: true } }
|
||||
: undefined
|
||||
);
|
||||
}
|
||||
|
||||
/** 409 `sessions-open` while live sessions use a connection of ours, else `undefined`. */
|
||||
private sessionsOpen(
|
||||
state: LocalModelStateFile,
|
||||
|
||||
Reference in new issue
Block a user