sprag-cli 3.124.1 → 3.124.2

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/package.json +1 -1
  2. package/src/team-sync.js +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprag-cli",
3
- "version": "3.124.1",
3
+ "version": "3.124.2",
4
4
  "description": "The delegation layer for Claude Code and Codex: each task goes to the model and effort that fits it, down to cheaper models for lookups and up to higher effort when a cheaper run would miss, backed by public replay cases, with a live statusline and team rules for Pro and Enterprise.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/team-sync.js CHANGED
@@ -730,6 +730,7 @@ export function deviceInfo({
730
730
  // optional `routing` argument, so the dashboard can tell why a PC does not
731
731
  // delegate. A server from before that argument answers PGRST202 ("Could not find
732
732
  // the function"): the call is repeated once without it.
733
+ const ROUTING_RETRY_MS = 3600 * 1000;
733
734
  export async function reportDeviceInfo({ state, dir = userDataDir(), fetch, env = process.env, routing } = {}) {
734
735
  if (teamSyncDisabled(env) || !isJoined(state)) return state;
735
736
  const info = deviceInfo();
@@ -738,8 +739,10 @@ export async function reportDeviceInfo({ state, dir = userDataDir(), fetch, env
738
739
  try { route = routingState(); } catch (e) { debug('team-sync', e); route = null; }
739
740
  }
740
741
  const same = state.deviceInfo && JSON.stringify(state.deviceInfo) === JSON.stringify(info);
741
- // After a fallback the server cannot take the argument yet: look again after a day, not on every sync.
742
- const waiting = Number(state.routingRetryAt) > Date.now();
742
+ // After a fallback the server cannot take the argument yet: look again after an hour, not on every sync.
743
+ // A wait stored by 3.124.1 (a day) is cut to the hour, so PCs that upgraded before the server did report soon.
744
+ const retryAt = Number(state.routingRetryAt), now = Date.now();
745
+ const waiting = retryAt > now && retryAt <= now + ROUTING_RETRY_MS;
743
746
  const routeSame = !route || waiting || JSON.stringify(state.routing || null) === JSON.stringify(route);
744
747
  if (same && routeSame) return state;
745
748
  try {
@@ -758,7 +761,7 @@ export async function reportDeviceInfo({ state, dir = userDataDir(), fetch, env
758
761
  }
759
762
  const next = { ...state, deviceInfo: info };
760
763
  if (route && !unsupported) next.routing = route; else delete next.routing;
761
- if (unsupported) next.routingRetryAt = Date.now() + 24 * 3600 * 1000; else delete next.routingRetryAt;
764
+ if (unsupported) next.routingRetryAt = Date.now() + ROUTING_RETRY_MS; else delete next.routingRetryAt;
762
765
  saveTeamState(next, dir);
763
766
  return next;
764
767
  } catch (e) {