teapot-coding-agent 0.14.1 → 0.14.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.
package/dist/master.js CHANGED
@@ -634,6 +634,18 @@ export class Master {
634
634
  try {
635
635
  dirs = readdirSync(this.sessionsRoot())
636
636
  .filter((d) => d === agentId || d.startsWith(`${agentId}-`))
637
+ .filter((d) => {
638
+ // an EMPTY chat.jsonl means the session was never used (created via
639
+ // web, then abandoned). Reusing it would resurrect another agent's
640
+ // timeline under this id, and two incarnations could even land in
641
+ // one directory. Never treat empty logs as existing history.
642
+ try {
643
+ return statSync(path.join(this.sessionsRoot(), d, "chat.jsonl")).size > 0;
644
+ }
645
+ catch {
646
+ return false;
647
+ }
648
+ })
637
649
  .sort((a, b) => {
638
650
  // newest chat.jsonl wins
639
651
  const ma = this.sessionMtime(path.join(this.sessionsRoot(), a));
@@ -657,6 +669,13 @@ export class Master {
657
669
  resolveSessionDir(agentId, fresh) {
658
670
  const root = this.sessionsRoot();
659
671
  mkdirSync(root, { recursive: true });
672
+ // exact-restart match first: <agentId> itself (or a previously generated
673
+ // <agentId>-<suffix> dir when the bare name was taken). Prefix matching
674
+ // alone could hand agent "proj-2" agent "proj"'s directory.
675
+ const selfDir = path.join(root, agentId);
676
+ if (!fresh && statSync(path.join(selfDir, "chat.jsonl"), { throwIfNoEntry: false })?.size) {
677
+ return selfDir; // restart → continue where we left off
678
+ }
660
679
  // one-time migration from the ≤0.5.0 flat layout (<dataDir>/<id>.jsonl)
661
680
  if (!fresh) {
662
681
  const legacy = path.join(this.config.dataDir, `${agentId}.jsonl`);
@@ -209,7 +209,10 @@ export function buildApp(master) {
209
209
  id = `${base.slice(0, 38)}-${n++}`;
210
210
  try {
211
211
  const agent = await master.addAgent({ id, workspace: ws, provider: body.provider, model: body.model }, { persist: true, fresh: true });
212
- if (body.start !== false)
212
+ // NOTE: creation no longer auto-starts an LLM loop — the agent sits in
213
+ // "stopped" (a lazy, zero-cost session) until the operator sends the
214
+ // first prompt or presses ▶ start. The web UI relies on this.
215
+ if (body.start === true)
213
216
  agent.start("created via web");
214
217
  return c.json({ ok: true, agent: agent.snapshot() });
215
218
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teapot-coding-agent",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "description": "A lightweight, always-on multi-agent harness for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",