shadok-ai 0.19.64 → 0.19.65

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/dist/server.js CHANGED
@@ -47,7 +47,7 @@ import { openBrowser } from "./open-browser.js";
47
47
  import { parseSkillMeta, prepromptParts, prepromptFingerprint, stalenessReasons, LEGACY_FINGERPRINT, } from "./preprompt.js";
48
48
  import { ensureSpawnHelperExecutable } from "./node-pty-fix.js";
49
49
  import { TmuxPilot, tmuxAvailable, tmuxHasSession, tmuxKillSession, tmuxPaneCwd, tmuxSessionCreated } from "./tmux.js";
50
- import { scanUsageSamples, scanUsageSamplesAsync, subagentDirFor, sessionFilePath, tailSession, clearTailPos, seedTailPos, isNothingToShow, newestTranscriptById } from "./tail.js";
50
+ import { scanUsageSamples, scanUsageSamplesAsync, subagentDirFor, sessionFilePath, resumeOrStartArgs, tailSession, clearTailPos, seedTailPos, isNothingToShow, newestTranscriptById } from "./tail.js";
51
51
  import { windowStats, latestModel } from "./token-stats.js";
52
52
  import { strandedWorktreePlan } from "./worktree-relocate.js";
53
53
  import { detectFork, rootIdOfFile } from "./forktrace.js";
@@ -9518,11 +9518,14 @@ user = null,
9518
9518
  /** The isolation group the agent belongs to (null = commons / mono-tenant),
9519
9519
  * so its profile's secrets resolve by the agent's REAL group, not always Main. */
9520
9520
  group = null) {
9521
- const pilot = makePilot(id, cwd, args, profile, model, effort, user, group);
9522
9521
  // A dropped group agent writes its transcript under ITS OWN home, not the
9523
9522
  // server's — so the content tail / history must read from there (invariant:
9524
9523
  // all content comes from the .jsonl). `agentStateHome` is the one answer.
9525
9524
  const transcriptHome = agentStateHome(user);
9525
+ // A resume of an agent that never got a first prompt has no transcript to
9526
+ // resume: start it under the same id instead (`resumeOrStartArgs`).
9527
+ args = resumeOrStartArgs(args, fs.existsSync(sessionFilePath(cwd, id, transcriptHome)));
9528
+ const pilot = makePilot(id, cwd, args, profile, model, effort, user, group);
9526
9529
  // Resumed sessions start with what the transcript already consumed. One scan
9527
9530
  // feeds both the context gauge (last message's usage) and the stats windows
9528
9531
  // (every message's usage + time + model), so a huge file is read once here.