@amenophis1er/foreman 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ <p align="center">
2
+ <img src="assets/brand/logo.svg" alt="" width="72" height="72">
3
+ </p>
4
+
1
5
  # Foreman
2
6
 
3
7
  Foreman runs software missions without you in the loop, and shows you
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amenophis1er/foreman",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Autonomous mission runner on the Claude Agent SDK: a director plans, delegates to workers, verifies, and reports — from one dashboard, your phone, or the CLI.",
5
5
  "keywords": [
6
6
  "claude",
package/src/server.ts CHANGED
@@ -1155,30 +1155,26 @@ async function resumeRun(projectId: string, meta: RunMeta, pick: {
1155
1155
  directorModel?: string; directorProviderId?: string; workerModel?: string; workerProviderId?: string;
1156
1156
  } = {}): Promise<void> {
1157
1157
  const sessionId = meta.directorSessionId;
1158
- // Resume re-reads Settings, so changing models or tool policy after a
1159
- // failure takes effect on the retry. A director session cannot switch
1160
- // model mid-session, so a changed director model restarts the session
1161
- // fresh (the mission doc carries the state forward).
1162
- const base = await effectiveSettings(projectId);
1163
- const settings = {
1164
- ...base,
1165
- ...(pick.directorModel ? { directorModel: modelChoice(pick.directorModel), directorProviderId: pick.directorProviderId } : {}),
1166
- ...(pick.workerModel ? { workerModel: modelChoice(pick.workerModel), workerProviderId: pick.workerProviderId } : {}),
1167
- };
1168
- // A model is picked together with the provider that serves it, so a
1169
- // change of either moves the role. Without the provider following the
1170
- // model, "resume on Sonnet" after a Codex usage limit went back through
1171
- // the Codex gateway which remapped the unknown id to its own default and
1172
- // hit the same 429. The provider id is left undefined when Settings does
1173
- // not pin one, which means the project's own provider, as at start.
1174
- const directorChanged =
1175
- (settings.directorModel !== undefined && settings.directorModel !== meta.directorModel)
1176
- || (settings.directorModel !== undefined && settings.directorProviderId !== meta.directorProviderId);
1177
- const workerChanged =
1178
- (settings.workerModel !== undefined && settings.workerModel !== meta.workerModel)
1179
- || (settings.workerModel !== undefined && settings.workerProviderId !== meta.workerProviderId);
1180
- if (directorChanged) { meta.directorModel = settings.directorModel; meta.directorProviderId = settings.directorProviderId; }
1181
- if (workerChanged) { meta.workerModel = settings.workerModel; meta.workerProviderId = settings.workerProviderId; }
1158
+ // Resume re-reads Settings for tool policy and auto-allow, so a policy
1159
+ // change after a failure takes effect on the retry. Models are the run's
1160
+ // own unless "Resume on…" says otherwise; a changed director model then
1161
+ // restarts the session fresh (the mission doc carries the state forward).
1162
+ const settings = await effectiveSettings(projectId);
1163
+ // A plain Resume keeps the run's own models. It used to re-read the
1164
+ // project's Settings and treat any difference as "the human changed the
1165
+ // model" but a run whose models were chosen at start (a local model
1166
+ // picked on the card) differs from Settings by construction, and one
1167
+ // Resume silently handed a 9B local-model test to Fable and Opus, at $4.82,
1168
+ // and called the result the 9B's. Changing models on resume is now only
1169
+ // ever explicit: "Resume on…" passes `pick`. A model is picked together
1170
+ // with the provider that serves it; a pick without a provider id means the
1171
+ // project's own provider, as at start.
1172
+ const directorChanged = Boolean(pick.directorModel) && (
1173
+ modelChoice(pick.directorModel) !== meta.directorModel || pick.directorProviderId !== meta.directorProviderId);
1174
+ const workerChanged = Boolean(pick.workerModel) && (
1175
+ modelChoice(pick.workerModel) !== meta.workerModel || pick.workerProviderId !== meta.workerProviderId);
1176
+ if (directorChanged) { meta.directorModel = modelChoice(pick.directorModel); meta.directorProviderId = pick.directorProviderId; }
1177
+ if (workerChanged) { meta.workerModel = modelChoice(pick.workerModel); meta.workerProviderId = pick.workerProviderId; }
1182
1178
  meta.toolPolicy = settings.toolPolicy;
1183
1179
  meta.autoAllowReadOnly = settings.autoAllowReadOnly;
1184
1180
  meta.status = 'running';