Commit Graph

525 Commits

Author SHA1 Message Date
Lyon 9574e2b514 feat: PJ2026-0104010803 P3 后端读侧推理清零 - session list + metric status 只读 projection (#1757)
server-workbench-http.ts:
- sessionListProjectionOptions: 当 session snapshot 已有 durable projection 字段
  (projectionStatus/terminal/sealedAt) 时,直接使用 projection 字段构建 turn projection,
  不再从 compactSessionTraceResult/compactSessionTraceSnapshot 多来源混合
- recordWorkbenchProjectionMetric: status 只读 projection.status,不再 fallback 到
  result?.status ?? trace?.status;source 固定为 workbench_read_model
- SPEC header 更新到 draft-2026-06-20-p3-read-side-zero

workbench-turn-projection.ts:
- SPEC header 更新到 draft-2026-06-20-p1-zero-split-durable-realtime

Closes #1749
Refs #1742
2026-06-20 19:34:52 +08:00
Lyon 7c5a1f8c5b feat: PJ2026-0104010803 P2 SSE/realtime 无状态化 - durable outbox cursor replay (#1756)
server-workbench-http.ts:
- handleWorkbenchRealtimeHttp 优先从 durable outbox 读取 (readWorkbenchProjectionOutbox)
- 当 runtimeStore 支持 outbox 时,SSE 用 polling cursor replay 代替 traceStore.subscribe
- outbox 不支持时保留内存 traceStore.subscribe 作为兼容降级
- terminal commit 从 outbox terminal 行触发 snapshot + trace realtime
- 新增 HWLAB_WORKBENCH_SSE_OUTBOX_POLL_MS 环境变量控制 poll 间隔

workbench-facts-store.ts:
- 新增 subscribeDurableProjection 方法,从 durable outbox polling 读取
- subscribeTrace 保留兼容(内存 trace),新增 durable projection subscription 入口
- SPEC header 更新到 draft-2026-06-20-p1-zero-split-durable-realtime

cloud-api 重启后 SSE 从 DB outbox cursor 继续输出,不依赖内存 listener

Closes #1748
Refs #1742
2026-06-20 19:31:49 +08:00
Lyon b254c1875e feat: PJ2026-0104010803 P1 durable projection outbox + DB constraints + error visibility (#1754)
DB migration (0001_cloud_core_skeleton.sql):
- Add (trace_id, source_event_id) unique index on workbench_trace_events
- Add (trace_id, projected_seq) unique index on workbench_trace_events
- Add workbench_projection_outbox table with BIGSERIAL outbox_seq

Schema (schema.ts):
- Bump CLOUD_RUNTIME_DURABLE_ADAPTER_SCHEMA_VERSION to v5
- Add workbench_projection_outbox to CLOUD_RUNTIME_DURABLE_TABLE_COLUMNS

Runtime store (runtime-store.ts):
- Add persistWorkbenchProjectionOutbox method
- Add readWorkbenchProjectionOutbox method for SSE cursor replay
- Write outbox rows in writeWorkbenchFacts for trace events and terminal turns
- Outbox write errors are logged, not silently swallowed

Trace store (code-agent-trace-store.ts):
- persistTraceEvent no longer uses .catch(() => {}) to swallow errors
- Projection write errors are logged with traceId/sourceEventId for diagnostics
- Sync errors also logged instead of empty catch block

SPEC headers updated to draft-2026-06-20-p1-zero-split-durable-realtime

Closes #1747
Refs #1742
2026-06-20 19:29:44 +08:00
lyon 062df3bf49 test: align user billing async agentrun coverage 2026-06-20 18:17:30 +08:00
lyon 3718b5d77d fix: persist manual workbench sessions 2026-06-20 16:58:31 +08:00
lyon c73b19fcaa feat(web): configure trace explorer links 2026-06-20 16:26:54 +08:00
lyon 11e2f08e70 fix: order workbench sessions by updated desc 2026-06-20 15:36:41 +08:00
lyon b139ffd8e4 feat: normalize cloud api error diagnostics 2026-06-20 15:08:33 +08:00
Lyon 199ee18b58 Merge pull request #1718 from pikasTech/feat/1708-p1-trace-context
[1708-P1] 贯通 Cloud API OTel trace 响应头
2026-06-20 14:55:53 +08:00
lyon efafeccfb9 feat: attach cloud api otel trace headers 2026-06-20 14:54:51 +08:00
lyon 03942afc5c fix: 收敛 workbench 消息头 timing 投影 2026-06-20 14:54:04 +08:00
lyon 32a66f18b3 fix: 统一上游不可达错误文案 2026-06-20 14:26:44 +08:00
lyon 4a9498d720 fix(workbench): expose code agent timing metadata 2026-06-20 13:55:57 +08:00
Lyon d2e147c019 fix: align performance summary problem counts (#1703) 2026-06-20 13:49:10 +08:00
lyon 01f72df333 fix: render workbench time from yaml config 2026-06-20 13:29:55 +08:00
lyon 6468263672 fix: thin workbench session list projection 2026-06-20 13:24:49 +08:00
Lyon 96704ea1d7 Merge pull request #1695 from pikasTech/codex/hwlab-1691-problem-rows
fix: separate performance problems from sample health
2026-06-20 12:47:57 +08:00
Lyon acd9831149 Fix workbench trace projection authority (#1696) 2026-06-20 12:47:18 +08:00
lyon 7448803c9d fix: separate performance problems from sample health 2026-06-20 12:46:29 +08:00
lyon 8c27242656 fix: scope workbench performance attribution health 2026-06-20 12:32:44 +08:00
lyon c8ff65f11f fix: reuse proven runtime readiness for workbench reads 2026-06-20 12:17:54 +08:00
lyon c9028519ca fix: overlap workbench session include query 2026-06-20 12:01:30 +08:00
Lyon ecbb13cdf4 fix: expose trace pagination in cli and otel (#1687) 2026-06-20 11:32:13 +08:00
lyon 1c4cf29274 feat: enrich AgentRun dispatch error OTel spans 2026-06-20 11:17:57 +08:00
lyon 793f0f39a4 fix: use projected trace cursor as workbench authority 2026-06-20 10:55:11 +08:00
lyon 1e484005c3 fix: reset invalid AgentRun profile session before run create 2026-06-20 10:40:32 +08:00
Lyon f637f32631 fix: parallelize workbench read-model fact reads (#1680) 2026-06-20 10:29:00 +08:00
lyon c3de9d6e4d fix: allow provider profile recovery after thread resume failure 2026-06-20 10:26:50 +08:00
lyon 28a7eaadfa fix: ignore poisoned AgentRun session thread after resume failure 2026-06-20 10:19:36 +08:00
lyon e91f9b5c0e fix: scope AgentRun thread reuse to backend profile session 2026-06-20 10:11:29 +08:00
Lyon 57ba729fca fix: reduce workbench read-model fact scans (#1676) 2026-06-20 10:02:38 +08:00
lyon c51dd122e2 fix: 区分 provider retry 与终态失败 2026-06-20 09:51:30 +08:00
Lyon 40a54eef20 feat: align rum samples with backend evidence (#1674) 2026-06-20 09:33:54 +08:00
lyon 4e64058614 feat: read workbench get from durable facts 2026-06-20 09:15:59 +08:00
Lyon e0127f1044 feat: expose performance collection health (#1671) 2026-06-20 09:03:17 +08:00
lyon e79ea2cb42 feat: persist workbench projection facts 2026-06-20 08:57:21 +08:00
lyon 6dd02cabc7 feat: add durable workbench facts store 2026-06-20 08:45:51 +08:00
lyon 786569eac0 fix: trace auth login with otel 2026-06-20 08:37:56 +08:00
lyon c318e8eadf fix: 支持 runtime store 连接池 YAML 配置 2026-06-20 08:01:59 +08:00
Lyon 037043b7c8 test: 收敛 Performance 迁移验证 (#1649) 2026-06-20 02:26:13 +08:00
Lyon ed7d187921 fix: 收敛 Performance summary 观测契约 (#1647) 2026-06-20 01:49:22 +08:00
lyon 8f9bdbd5fd fix: harden workbench trace timeout observability 2026-06-20 01:16:45 +08:00
lyon 4eadd2f85a fix: trace workbench loading states with otel 2026-06-20 00:47:57 +08:00
lyon c189270fca feat: add performance summary time windows 2026-06-20 00:29:13 +08:00
lyon c3ca0f869e fix: seal workbench final response from terminal trace 2026-06-20 00:11:35 +08:00
lyon c2629c5ebf fix: improve code agent trace visibility 2026-06-20 00:04:23 +08:00
lyon 638509bcf1 fix: use compact workbench session summaries 2026-06-19 23:39:54 +08:00
lyon 69b8e03661 feat: add code agent otel spans 2026-06-19 23:05:50 +08:00
lyon 5f1763aeac fix: persist workbench turn admission before preflight 2026-06-19 21:55:15 +08:00
lyon 7544b52c27 fix: reduce workbench session list load 2026-06-19 21:52:42 +08:00