@bivy/bivy 0.10.1-staging.253 → 0.10.1-staging.255

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.
Files changed (2) hide show
  1. package/dist/server.js +8 -8
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -4644,21 +4644,21 @@ async function continueCorrelatedSession(item, prompt, report, opts) {
4644
4644
  // failed run rather than silently starting a new session. Everything else
4645
4645
  // keeps the established best-effort fall-through to a fresh pickup.
4646
4646
  if (opts?.resumeOnMissing) {
4647
- throw new Error(`Scheduled message could not be delivered: session ${item.targetSessionId} is not available on this node`);
4647
+ throw new Error(`This Run could not continue session ${item.targetSessionId}: the session is not available on this Machine`);
4648
4648
  }
4649
4649
  return false;
4650
4650
  }
4651
4651
  const branch = record.worktree?.branch;
4652
4652
  if (opts?.resumeOnMissing) {
4653
- // "Send when the turn ends": a scheduled message that fires mid-turn waits
4654
- // for the session to go idle instead of interrupting it (bounded, so a
4655
- // stuck session still surfaces as a failed run rather than hanging forever).
4653
+ // Durable work targeting an existing Session waits for its current turn to
4654
+ // settle instead of interrupting it (bounded, so a stuck Session surfaces
4655
+ // as a failed Run rather than hanging forever).
4656
4656
  await waitForSessionIdle(record);
4657
4657
  // Double-send guard: when the app is open and already delivered this exact
4658
4658
  // message as a follow-up (and deleted the pending schedule), the scheduled
4659
4659
  // run must not send it a second time. Matches the last user message, which
4660
4660
  // is all a text-only scheduled message can have produced.
4661
- if (lastUserMessageText(record).trim() === prompt.trim()) {
4661
+ if (opts.isMessage && lastUserMessageText(record).trim() === prompt.trim()) {
4662
4662
  await report({
4663
4663
  output: { sessionId: record.id },
4664
4664
  events: [{
@@ -4679,7 +4679,7 @@ async function continueCorrelatedSession(item, prompt, report, opts) {
4679
4679
  await runSessionTurn(record, prompt, opts?.signal);
4680
4680
  if (opts?.signal?.aborted)
4681
4681
  throw opts.signal.reason ?? new Error("Run cancelled");
4682
- if (record.worktree && !opts?.isMessage && !opts?.resumeOnMissing) {
4682
+ if (record.worktree && !opts?.isMessage) {
4683
4683
  await branchPublish.maybePushWorktreeBranch(record);
4684
4684
  await prDetection.maybeDetectPullRequest(record);
4685
4685
  }
@@ -4817,7 +4817,7 @@ async function runWorkItem(item, report, signal) {
4817
4817
  throw new Error(`Linear work item has an invalid repo "${repoSlug}"`);
4818
4818
  // Case B: a re-dispatch the control plane correlated to an existing session
4819
4819
  // continues it as a normal chat instead of starting cold (mirrors GitHub).
4820
- if (await continueCorrelatedSession(item, buildLinearTaskPrompt(issue), report, { signal }))
4820
+ if (await continueCorrelatedSession(item, buildLinearTaskPrompt(issue), report, { resumeOnMissing: item.targetKind === "existing_session", signal }))
4821
4821
  return;
4822
4822
  const githubToken = await resolveGitHubToken();
4823
4823
  if (!githubToken)
@@ -4877,7 +4877,7 @@ async function runWorkItem(item, report, signal) {
4877
4877
  // Scheduled runs targeting an existing session are STRICT: the message must
4878
4878
  // land in that session (resumed from disk if needed), never silently in a new
4879
4879
  // one — so a session that can't be resumed fails the run instead.
4880
- if (await continueCorrelatedSession(item, request, report, { resumeOnMissing: item.source === "schedule", isMessage, signal }))
4880
+ if (await continueCorrelatedSession(item, request, report, { resumeOnMissing: item.source === "schedule" || item.targetKind === "existing_session", isMessage, signal }))
4881
4881
  return;
4882
4882
  const requestedSandbox = normalizeSandboxTier(item.sandbox);
4883
4883
  // Prepare an explicit repository before resolving its policy. Otherwise a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bivy/bivy",
3
- "version": "0.10.1-staging.253",
3
+ "version": "0.10.1-staging.255",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0-only",
6
6
  "description": "Run coding agents on machines you own. Open-source, self-hostable agent workspace.",