GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): a failed lookup no longer drops a delegated task's analy… · pingdotgg/t3code@e9e0aa1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/telemetry
    • DelegatedTaskAnalytics.test.ts
    • DelegatedTaskAnalytics.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/telemetry/DelegatedTaskAnalytics.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/telemetry/DelegatedTaskAnalytics.test.ts
+11-6Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ const subagentEvent = (status: string, origin = "app_owned") =>
3131

3232
it.effect("records each delegated task's final outcome once, without ids or prompts", () => {
3333
const recorded: Array<{ event: string; properties: unknown }> = [];
34+
let shellLookups = 0;
3435
return Effect.gen(function* () {
3536
const analytics = yield* DelegatedTaskAnalytics.DelegatedTaskAnalytics;
3637
yield* analytics.onSubagent(subagentEvent("running"));
3738
yield* analytics.onSubagent(subagentEvent("completed", "provider_native"));
39+
// The first parent lookup fails; the next final update still reports the task.
40+
yield* analytics.onSubagent(subagentEvent("completed"));
3841
yield* analytics.onSubagent(subagentEvent("completed"));
3942
yield* analytics.onSubagent(subagentEvent("completed"));
4043
expect(recorded).toEqual([
@@ -60,12 +63,14 @@ it.effect("records each delegated task's final outcome once, without ids or prom
6063
Layer.mock(Orchestrator.OrchestratorV2)({
6164
streamDomainEvents: Stream.empty,
6265
getThreadShell: () =>
63-
Effect.succeed({
64-
modelSelection: {
65-
instanceId: ProviderInstanceId.make("codex"),
66-
model: "gpt-5.5",
67-
},
68-
} as never),
66+
++shellLookups === 1
67+
? Effect.die("thread store unavailable")
68+
: Effect.succeed({
69+
modelSelection: {
70+
instanceId: ProviderInstanceId.make("codex"),
71+
model: "gpt-5.5",
72+
},
73+
} as never),
6974
}),
7075
Layer.mock(ProviderRegistry.ProviderRegistry)({
7176
getProviders: Effect.succeed([
Collapse file

‎apps/server/src/telemetry/DelegatedTaskAnalytics.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/telemetry/DelegatedTaskAnalytics.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const make = Effect.gen(function* () {
4545
const task = event.payload;
4646
if (task.origin !== "app_owned" || !FINAL_STATUSES.has(task.status)) return;
4747
if (reported.has(task.id)) return;
48-
reported.add(task.id);
4948
const parent = yield* orchestrator.getThreadShell(task.threadId);
5049
const providers = yield* registry.getProviders;
5150
const parentDimensions =
@@ -78,6 +77,8 @@ const make = Effect.gen(function* () {
7877
...(task.completionWake === undefined ? {} : { completionWake: task.completionWake }),
7978
...(durationSeconds === undefined ? {} : { durationSeconds }),
8079
});
80+
// Only after recording: a failed lookup leaves the next final update to report it.
81+
reported.add(task.id);
8182
}).pipe(Effect.ignoreCause);
8283

8384
yield* forkParked(

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.