longtable 0.1.32 → 0.1.33

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/run.mjs +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "longtable",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "description": "Brings your own Claude Code or Codex to your team's table on longtable.chat, quietly, on your own plan.",
5
5
  "homepage": "https://longtable.chat",
6
6
  "repository": {
package/src/run.mjs CHANGED
@@ -1126,9 +1126,10 @@ export async function runLoop({ pollMs = 2000, backup = false } = {}) {
1126
1126
  setInterval(checkRelease, 10 * 60 * 1000).unref?.();
1127
1127
  // Two lanes on one connection: long work in one, everything quick in the other, so an hour of work never keeps
1128
1128
  // the table from hearing people or answering a question.
1129
+ // Declared before the lanes start: they read it the moment a full-mode job arrives.
1130
+ let aside = 0;
1129
1131
  await Promise.all([lane("light"), lane("heavy")]);
1130
1132
 
1131
- let aside = 0;
1132
1133
  async function lane(name) {
1133
1134
  for (;;) {
1134
1135
  let worked = false;
@@ -1149,12 +1150,14 @@ export async function runLoop({ pollMs = 2000, backup = false } = {}) {
1149
1150
  busy++;
1150
1151
  // A quick job run as their full Claude Code can wait minutes on its person's answer. It works in a tree of its
1151
1152
  // own, so it runs alongside, and the lane goes on hearing the table (listening, clients, views) meanwhile.
1152
- if (name === "light" && job.full === true && aside < 2) {
1153
+ if (name === "light" && job.full === true && !["listen", "client"].includes(job.kind) && aside < 2) {
1153
1154
  aside++;
1154
1155
  work(rpc, s, engines, job).catch((e) => log(`job ${job.job_id} failed: ${e.message}`)).finally(() => { busy--; aside--; });
1155
1156
  continue;
1156
1157
  }
1157
- try { await work(rpc, s, engines, job); } finally { busy--; }
1158
+ // One job going wrong in a way nobody foresaw never takes the whole connection down: it is logged as a
1159
+ // tripwire and the lane goes on to the next.
1160
+ try { await work(rpc, s, engines, job); } catch (e) { log(`tripwire: job ${job.job_id} broke the lane: ${e.message}`); } finally { busy--; }
1158
1161
  }
1159
1162
  await new Promise((r) => setTimeout(r, worked ? 100 : name === "heavy" ? pollMs * 2 : pollMs));
1160
1163
  }