longtable 0.1.26 → 0.1.27
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/package.json +1 -1
- package/src/run.mjs +5 -0
package/package.json
CHANGED
package/src/run.mjs
CHANGED
|
@@ -733,6 +733,7 @@ async function workListen(rpc, seat, engines, job) {
|
|
|
733
733
|
let s;
|
|
734
734
|
let model;
|
|
735
735
|
let usage;
|
|
736
|
+
let limits = null;
|
|
736
737
|
if (seat.kind === "codex") {
|
|
737
738
|
const result = await askCodex({ codex: engines.codex, prompt: `${listenSystem(job)}${NL}${NL}${listenPrompt(job)}`, schema });
|
|
738
739
|
s = result.tools.length ? { act: "silent", reply: "" } : result.structured_output;
|
|
@@ -747,12 +748,16 @@ async function workListen(rpc, seat, engines, job) {
|
|
|
747
748
|
s = result.structured_output;
|
|
748
749
|
model = Object.keys(result.modelUsage || {})[0] || "haiku";
|
|
749
750
|
usage = { input: result.usage?.input_tokens, output: result.usage?.output_tokens, wall_ms: result.wall_ms, cost_usd_equivalent: result.total_cost_usd };
|
|
751
|
+
limits = result.limits;
|
|
750
752
|
}
|
|
751
753
|
const act = ["silent", "reply", "look", "work"].includes(s?.act) ? s.act : "silent";
|
|
752
754
|
const label = /^T(\d+)$/.exec(String(s?.task || "").trim());
|
|
753
755
|
const task = label ? (job.tasks || [])[Number(label[1]) - 1]?.id || "" : "";
|
|
754
756
|
await rpc("runner_finish", { token: seat.token, job: job.job_id, answer: act === "reply" ? String(s.reply || "") : "", info: { act, model, usage, task, title: String(s?.title || "").slice(0, 80) } });
|
|
755
757
|
log(`listen job ${job.job_id}: ${act}`);
|
|
758
|
+
// The plan's use moves with every message heard, not only with bigger jobs, so Usage stays current. The person's
|
|
759
|
+
// own model is kept: the listener runs on its own small one.
|
|
760
|
+
if (limits) await report(rpc, seat, { ai: "claude", ...limits, models: ["opus", "sonnet", "haiku"] }, null);
|
|
756
761
|
}
|
|
757
762
|
|
|
758
763
|
// People's and tables' names come from the table like any other words, and go into the AI's own instructions: a
|