@gotcos/glasses-server 6.39.0 → 6.39.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/CHANGELOG.md CHANGED
@@ -1,3 +1,34 @@
1
+ ## 6.39.2
2
+
3
+ Every Claude fork failed; the copy it left behind was real.
4
+
5
+ `buildClaudeForkArgs` still carried `--tools ''`, the third read-only layer the
6
+ attached path retired on 2026-08-16. On the current Claude CLI that flag makes
7
+ a fork-resume attempt a context compaction that fails (`too_few_groups`) and
8
+ then report a synthetic 400 "Prompt is too long" with zero input tokens -- so
9
+ the route classified every claude fork `fork_orphan_possible` even though the
10
+ forked transcript sat on disk complete except for the failed turn. Found the
11
+ hour COS Control 0.5.76 put a Fork button in front of the route; isolated by
12
+ single-flag bisection (plan-only completes, allowedTools-only completes,
13
+ `--tools ''` alone reproduces).
14
+
15
+ The fork keeps its read-only stance -- `--permission-mode plan` plus an empty
16
+ `--allowedTools` -- and drops only the flag the CLI can no longer carry.
17
+ Pinned by a regression test that goes red if `--tools` returns to the argv.
18
+
19
+ ## 6.39.1
20
+
21
+ Durable jobs now remember they ran on Ollama.
22
+
23
+ FIXED: 6.39.0 allowed `provider: 'ollama'` in the durable-job types and the
24
+ runtime stamped it, but the journal sanitizer (`safeLinkage`) and the replay
25
+ reader (`applyLinkage`) both stripped it -- so a live or replayed Ollama job
26
+ came back providerless and the phone could never acknowledge which engine
27
+ answered. Both now persist `ollama` and `ollamaRunId`; unknown providers still
28
+ strip. Pinned by journal round-trip tests, mutation-verified.
29
+
30
+ No other changes; pairs with COS Glasses 6.8.436 and COS Control 0.5.74.
31
+
1
32
  ## 6.39.0
2
33
 
3
34
  Ollama is a fourth G2 picker, hidden unless a local daemon answers.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gotcos/glasses-server",
3
- "version": "6.39.0",
3
+ "version": "6.39.2",
4
4
  "description": "COS Glasses \u2014 self-hosted AI heads-up-display server for Even G2 smart glasses, powered by Claude Code, Codex, Cursor Agent CLI, or local Ollama",
5
5
  "type": "module",
6
6
  "bin": {
@@ -211,11 +211,18 @@ export function forkOrphanPossible(result: ForkResult): boolean {
211
211
  * `claude -p --resume <id> --fork-session`, read-only, prompt on stdin.
212
212
  *
213
213
  * `--fork-session` is documented by the installed CLI as "When resuming, create a
214
- * new session ID" and is only meaningful alongside `--resume`. The read-only pair
215
- * (`--permission-mode plan` plus the empty tool lists) is carried over from the
216
- * attached path unchanged: a fork runs a real model turn, and it does so against a
217
- * workspace the user did not explicitly hand us, so it gets no more authority than
218
- * a continuation does.
214
+ * new session ID" and is only meaningful alongside `--resume`. The fork keeps a
215
+ * read-only stance a fork runs a real model turn against a workspace the user
216
+ * did not explicitly hand us but that stance is now `--permission-mode plan`
217
+ * plus an empty `--allowedTools` only. The third layer this used to carry,
218
+ * `--tools ''`, is GONE: on the current CLI an empty --tools on a fork-resume
219
+ * triggers a spurious context compaction (`too_few_groups`) followed by a
220
+ * synthetic 400 "Prompt is too long" with zero input tokens — every claude fork
221
+ * failed as orphan_possible while the transcript copy sat there complete.
222
+ * Isolated by single-flag bisection on 2026-08-26: plan-only completed,
223
+ * allowedTools-only completed, `--tools ''` alone reproduced the failure. (The
224
+ * attached path dropped all three layers on 2026-08-16 by explicit decision;
225
+ * the fork deliberately keeps the two that still work.)
219
226
  *
220
227
  * `stream-json` requires `--verbose`; without it the CLI refuses and we would never
221
228
  * see the id we are required to verify.
@@ -228,7 +235,6 @@ export function buildClaudeForkArgs(nativeThreadId: string): string[] {
228
235
  '--resume', nativeThreadId,
229
236
  '--fork-session',
230
237
  '--permission-mode', 'plan',
231
- '--tools', '',
232
238
  '--allowedTools', '',
233
239
  ]
234
240
  }
@@ -550,11 +550,11 @@ export class QueryJobStore {
550
550
  }
551
551
 
552
552
  private applyLinkage(snapshot: QueryJobSnapshot, raw: Record<string, unknown>): void {
553
- const provider = raw.provider === 'claude' || raw.provider === 'codex' || raw.provider === 'cursor'
553
+ const provider = raw.provider === 'claude' || raw.provider === 'codex' || raw.provider === 'cursor' || raw.provider === 'ollama'
554
554
  ? raw.provider
555
555
  : undefined
556
556
  if (provider) snapshot.provider = provider
557
- const fields = ['resolvedModel', 'cliSessionId', 'claudeRunId', 'codexRunId', 'codexThreadId', 'cursorRunId'] as const
557
+ const fields = ['resolvedModel', 'cliSessionId', 'claudeRunId', 'codexRunId', 'codexThreadId', 'cursorRunId', 'ollamaRunId'] as const
558
558
  for (const field of fields) {
559
559
  const value = safeOptional(raw[field])
560
560
  if (value) snapshot[field] = value
@@ -886,7 +886,11 @@ export class QueryJobStore {
886
886
 
887
887
  private safeLinkage(linkage: QueryJobProviderLinkage): QueryJobProviderLinkage {
888
888
  return {
889
- ...(linkage.provider === 'claude' || linkage.provider === 'codex' || linkage.provider === 'cursor'
889
+ // 'ollama' joined this allowlist in 6.39.1. The 6.39.0 types allowed it and
890
+ // query-job-runtime stamped it, but this sanitizer silently dropped it on
891
+ // persist -- so phone acknowledgement of a live or replayed Ollama job could
892
+ // never see its provider. Unknown providers still strip.
893
+ ...(linkage.provider === 'claude' || linkage.provider === 'codex' || linkage.provider === 'cursor' || linkage.provider === 'ollama'
890
894
  ? { provider: linkage.provider }
891
895
  : {}),
892
896
  ...(safeOptional(linkage.resolvedModel, 64) ? { resolvedModel: safeOptional(linkage.resolvedModel, 64) } : {}),
@@ -895,6 +899,7 @@ export class QueryJobStore {
895
899
  ...(safeOptional(linkage.codexRunId) ? { codexRunId: safeOptional(linkage.codexRunId) } : {}),
896
900
  ...(safeOptional(linkage.codexThreadId) ? { codexThreadId: safeOptional(linkage.codexThreadId) } : {}),
897
901
  ...(safeOptional(linkage.cursorRunId) ? { cursorRunId: safeOptional(linkage.cursorRunId) } : {}),
902
+ ...(safeOptional(linkage.ollamaRunId) ? { ollamaRunId: safeOptional(linkage.ollamaRunId) } : {}),
898
903
  }
899
904
  }
900
905