gipity 1.0.427 → 1.0.428

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/index.js CHANGED
@@ -43505,18 +43505,26 @@ async function handleDispatch(claimed) {
43505
43505
  await ack(d.short_guid, "error", `Could not materialize project locally: ${err?.message || err}`);
43506
43506
  return;
43507
43507
  }
43508
- if (bootstrapped) {
43509
- pushSystem("Syncing project files\u2026");
43508
+ const hasAttachments = (d.attachments?.length ?? 0) > 0;
43509
+ if (bootstrapped || hasAttachments) {
43510
+ pushSystem(bootstrapped ? "Syncing project files\u2026" : "Syncing attached files\u2026");
43510
43511
  let syncKilled = false;
43512
+ let syncFailed = false;
43511
43513
  try {
43512
43514
  syncKilled = (await runDispatchSync(d, cwd)).killed;
43513
43515
  } catch (err) {
43514
43516
  const msg = `project sync ${err?.message || "failed"}`;
43515
- log2("error", "project sync failed - aborting dispatch", { id: d.short_guid, err: err?.message });
43516
- pushSystem(`Claude Code not started - ${msg}`);
43517
- await flushQueue();
43518
- await ack(d.short_guid, "error", msg);
43519
- return;
43517
+ if (!bootstrapped) {
43518
+ syncFailed = true;
43519
+ log2("error", "attachment pre-sync failed - continuing", { id: d.short_guid, err: err?.message });
43520
+ pushSystem(`Attached-file sync failed (${err?.message || "failed"}) - Claude will sync on demand.`);
43521
+ } else {
43522
+ log2("error", "project sync failed - aborting dispatch", { id: d.short_guid, err: err?.message });
43523
+ pushSystem(`Claude Code not started - ${msg}`);
43524
+ await flushQueue();
43525
+ await ack(d.short_guid, "error", msg);
43526
+ return;
43527
+ }
43520
43528
  }
43521
43529
  if (syncKilled) {
43522
43530
  log2("info", "dispatch cancelled during project sync", { id: d.short_guid });
@@ -43525,7 +43533,7 @@ async function handleDispatch(claimed) {
43525
43533
  await ack(d.short_guid, "cancelled");
43526
43534
  return;
43527
43535
  }
43528
- pushSystem("Project files synced.");
43536
+ if (!syncFailed) pushSystem(bootstrapped ? "Project files synced." : "Attached files synced.");
43529
43537
  }
43530
43538
  if (SESSION_POOL_ENABLED) {
43531
43539
  const handled = await tryHandleViaPool(d, cwd, queue, pushSystem, flushQueue);
@@ -894,23 +894,37 @@ async function handleDispatch(claimed) {
894
894
  return;
895
895
  }
896
896
  // Explicit, user-visible, timeout-bounded project sync BEFORE starting Claude -
897
- // only on a freshly bootstrapped dir (the files aren't there yet). Pull the
898
- // project's files first so Claude works against the real tree; a hung/slow sync
899
- // is killed at PROJECT_SYNC_TIMEOUT_MS and reported instead of silently stalling
900
- // the dispatch (the old in-process bootstrap sync could hang forever).
901
- if (bootstrapped) {
902
- pushSystem('Syncing project files…');
897
+ // on a freshly bootstrapped dir (the files aren't there yet), and whenever the
898
+ // dispatch carries web-attached files (they were just uploaded to the project
899
+ // VFS; pull them so the agent finds them at the paths the message names).
900
+ // A hung/slow sync is killed at PROJECT_SYNC_TIMEOUT_MS and reported instead
901
+ // of silently stalling the dispatch.
902
+ const hasAttachments = (d.attachments?.length ?? 0) > 0;
903
+ if (bootstrapped || hasAttachments) {
904
+ pushSystem(bootstrapped ? 'Syncing project files…' : 'Syncing attached files…');
903
905
  let syncKilled = false;
906
+ let syncFailed = false;
904
907
  try {
905
908
  syncKilled = (await runDispatchSync(d, cwd)).killed;
906
909
  }
907
910
  catch (err) {
908
911
  const msg = `project sync ${err?.message || 'failed'}`;
909
- log('error', 'project sync failed - aborting dispatch', { id: d.short_guid, err: err?.message });
910
- pushSystem(`Claude Code not started - ${msg}`);
911
- await flushQueue();
912
- await ack(d.short_guid, 'error', msg);
913
- return;
912
+ if (!bootstrapped) {
913
+ syncFailed = true;
914
+ // Attachment pre-sync on an EXISTING tree: degrade instead of
915
+ // aborting - the message's attachment note already tells the agent
916
+ // to `gipity sync` any missing file itself, and the rest of the
917
+ // project is present. Only a bootstrap (no files at all) is fatal.
918
+ log('error', 'attachment pre-sync failed - continuing', { id: d.short_guid, err: err?.message });
919
+ pushSystem(`Attached-file sync failed (${err?.message || 'failed'}) - Claude will sync on demand.`);
920
+ }
921
+ else {
922
+ log('error', 'project sync failed - aborting dispatch', { id: d.short_guid, err: err?.message });
923
+ pushSystem(`Claude Code not started - ${msg}`);
924
+ await flushQueue();
925
+ await ack(d.short_guid, 'error', msg);
926
+ return;
927
+ }
914
928
  }
915
929
  if (syncKilled) {
916
930
  // The user cancelled (or a newer message for this conv superseded us)
@@ -922,7 +936,8 @@ async function handleDispatch(claimed) {
922
936
  await ack(d.short_guid, 'cancelled');
923
937
  return;
924
938
  }
925
- pushSystem('Project files synced.');
939
+ if (!syncFailed)
940
+ pushSystem(bootstrapped ? 'Project files synced.' : 'Attached files synced.');
926
941
  }
927
942
  // Phase 2: if the session pool is enabled, try to run this turn in a
928
943
  // long-lived Claude Code session (fast follow-up + clean interrupt). Any
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gipity",
3
- "version": "1.0.427",
3
+ "version": "1.0.428",
4
4
  "description": "The full-stack platform tuned for AI agents. Database, storage, auth, functions, deploy, and drop-in kits - all agent-tuned. Pair with Claude Code or use standalone.",
5
5
  "bin": {
6
6
  "gipity": "dist/updater/shim.js",