Commit Graph

65 Commits

Author SHA1 Message Date
Lyon fc865dbc7c Merge pull request #1005 from pikasTech/fix/issue1000-trace-refresh-latency
fix: reduce Code Agent trace refresh latency
2026-06-06 16:56:05 +08:00
Codex Agent 263bbbb159 fix: keep steer short connection running 2026-06-06 16:52:32 +08:00
Codex Agent 689c471e4d fix: reduce Code Agent trace refresh latency 2026-06-06 16:51:40 +08:00
Codex Agent 6cae643161 fix: remove legacy trace fallback paths 2026-06-06 13:55:03 +08:00
Codex dd0121c93c fix: stabilize AgentRun trace replay and final rows 2026-06-06 10:33:26 +08:00
Codex Agent 42b53e5795 fix: discover preinstalled hwpod specs 2026-06-06 01:49:59 +08:00
Codex Agent c7e210cf96 fix: preserve structured markdown final response 2026-06-06 01:37:44 +08:00
Codex Agent 8f7bc79d1e fix: prefer terminal markdown final response 2026-06-06 01:23:18 +08:00
Codex Agent 02bd350f46 fix: keep compact trace replay timers stable 2026-06-06 01:04:39 +08:00
Codex Agent faad89fc6f fix: preserve natural final response markdown 2026-06-06 00:58:31 +08:00
Codex Agent 3b04a0cf5b fix: replay compact traces after route switches 2026-06-06 00:46:32 +08:00
Codex Agent eeb759f970 fix: avoid false expired trace labels 2026-06-06 00:23:00 +08:00
Lyon 0b6aa9f628 fix: pin workbench grid placement (#953)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-05 23:28:44 +08:00
Codex Agent 243157aacd fix: improve webui steer and markdown rendering 2026-06-05 23:14:58 +08:00
Codex Agent 385d48613a fix: expose provider config editing in management 2026-06-05 23:01:50 +08:00
Codex Agent e74acf333b fix: preserve workbench project refresh path 2026-06-05 22:57:42 +08:00
Codex Agent d2ee808133 fix: collapse trace after final response 2026-06-05 22:34:03 +08:00
Codex Agent 7637a43699 fix: preserve code agent final response text 2026-06-05 22:30:29 +08:00
Lyon 8ae0f55463 fix: repair webui refresh trace layout (#938)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-05 22:10:14 +08:00
Codex Agent 3e7131f6ab refactor: converge hwpod node-ops channel 2026-06-05 17:23:56 +08:00
Codex Agent 9a2c651c3c feat: add v02 provider profile management 2026-06-05 17:14:59 +08:00
Codex Agent e54b3672d9 fix: keep v02 workspace history out of first screen LCP 2026-06-05 17:00:35 +08:00
Codex Agent 20ced5245b fix: collapse v02 workspace first screen bootstrap 2026-06-05 16:24:33 +08:00
Codex Agent 775c986a72 fix: prioritize v02 workspace first screen 2026-06-05 15:55:18 +08:00
Codex Agent 946d550056 fix: stabilize v02 workspace first paint 2026-06-05 14:58:37 +08:00
Codex Agent 896489a1c2 fix: speed up v02 workspace first screen 2026-06-05 14:23:32 +08:00
Codex Agent ac2d3001fa fix: depollute v02 web performance telemetry 2026-06-05 13:03:09 +08:00
Codex Agent f5be1c0361 feat: add v02 web performance dashboard 2026-06-05 12:00:23 +08:00
Codex Agent ab7d79c69a feat: expose v02 webui performance metrics 2026-06-05 11:14:27 +08:00
Codex Agent cf722efd06 feat: add v02 OpenFGA access management 2026-06-05 09:39:49 +08:00
Lyon 0fdd659826 fix(v02): retry trace snapshot before failure persist (#873)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 23:32:08 +08:00
Lyon 5107160786 fix(v02): persist trace for failed chat submits (#872)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 23:10:10 +08:00
Lyon 99d0604861 fix(v02): preserve trace for terminal chat responses (#868)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 22:53:31 +08:00
Lyon de0f79c3ce fix(v02): replay empty loaded traces (#865)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 22:31:44 +08:00
Lyon ffae1c12e0 fix(v02): retry historical trace replay (#864)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 22:17:58 +08:00
Lyon ec4ab46411 fix(v02): collapse duplicate assistant trace snapshots (#863)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 22:10:23 +08:00
Lyon 03f604d3fe fix(v02): persist terminal trace before refresh (#861)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 22:05:59 +08:00
Lyon c4ff24f60a fix(v02): dedupe replayed trace tool rows (#860)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 21:49:57 +08:00
Lyon 7652b39235 fix(v02): persist Web refresh state (#859)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 21:45:40 +08:00
Lyon 412f95f1a5 fix(v02): unify web trace markdown rendering (#858)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 21:33:01 +08:00
Lyon 84e649c294 fix(v02): load compact conversation traces (#856)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 21:12:07 +08:00
Lyon 2129cebfef fix(v02): improve trace and sidebar web ui (#854)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 20:56:43 +08:00
Lyon 3f26ec0b16 fix(v02): add workspace scroll follow and markdown renderer (#839)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 17:50:47 +08:00
Lyon 2fc3972ddd fix(v02): compact workbench status panels (#838)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 17:47:56 +08:00
Lyon be557c09bc fix(v02): repair final response status (#837)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 17:45:25 +08:00
Codex Agent 7a58695318 fix(v02): unify web trace final response 2026-06-04 17:29:28 +08:00
Codex Agent e46350993c fix: compact code agent workbench layout 2026-06-04 15:26:13 +08:00
Codex Agent caf5e6cde5 fix(web): v0.2 drop Agent workspace intro System cards, fold 界面模式 into panel title hint (HWLAB #803 followup)
PR #807 collapsed the top #code-agent-summary and per-message debug panels
into a 调试信息 dialog, but the conversation list still showed two hard-coded
System cards (界面模式 / Code Agent 状态) that fed availability into the
agent run path. Both appeared as full <article class="message-card
message-system"> bubbles before any user message on every session load,
contradicting the issue goal of a clean agent / user conversation feed.

- remove the ConversationPanel intro useMemo + [...intro, ...messages]
  spread; the conversation list now only contains real agent / user
  messages.
- move the static 界面模式 content to a small muted hint line under the
  panel title (id=workspace-hint, .conversation-panel-hint).
- the live Code Agent availability snapshot is already covered by the
  existing #code-agent-summary + 调试信息 dialog, so it is dropped.
- add a conversation-list empty-state placeholder so the panel keeps
  height for layout smoke (messages.length === 0).
- delete the now-orphan MessageRuntimePath / MessageSessionContinuity /
  MessagePendingContext components (no remaining callers per rg).
- extend tools/capture-issue-803-noise.mjs to report each .message-card
  role plus systemMessageCount / roleCounts so layout-level evidence
  can assert "no message-system in the conversation list".

web:check 12 pass / 0 fail; web:layout:build pass (desktop, narrow,
mobile). Issue: pikasTech/HWLAB#803
2026-06-04 13:48:29 +08:00
Lyon fb267d28b2 fix(web): v0.2 collapse Agent workspace debug noise into a 调试信息 dialog (HWLAB #803) (#807)
The Agent workspace (top #code-agent-summary and each agent message card)
exposed too many "未观测" / readiness / providerTrace / runtime-path rows
inline; per-message panels (MessageRuntimePath, MessageSessionContinuity,
MessagePendingContext) ate most of the card width and made the agent trace
events list (the only thing the user really wants to see) read at ~83% of
the card.

This change:
- introduces a reusable <DebugDialog> component (web/hwlab-cloud-web/src/components/shared/DebugDialog.tsx)
  that surfaces the full availability / readiness / runnerTrace / raw JSON
  payload only when the user clicks a 调试信息 button.
- shrinks codeAgentSummaryRows() in state/code-agent-status.ts to only
  return rows with meaningful values; "未观测" / "字段缺失:证据不足" /
  "DEGRADED:运行路径字段不完整" / "无"-only readiness blockers are
  filtered out of the top summary and remain reachable via the dialog.
- rewrites MessageCard to drop the inline MessageRuntimePath /
  MessageSessionContinuity / MessagePendingContext panels and to show a
  single compact footer (timestamp + 调试信息 button). The pending running
  hint is reduced to a one-line tag instead of a 7-row grid.
- makes .message-trace and .message-trace-events fill the message card so
  the trace events list is the dominant element per the issue.
- adds tools/capture-issue-803-noise.mjs so CLI can log into the live or
  local Cloud Web, capture the rendered #code-agent-summary / per-message
  meta / trace widths into a JSON document, and diff before/after the
  refactor.

web:check, web:layout, dev-cloud-workbench-smoke --static, and
dev-cloud-workbench-layout-smoke all pass on the local build.
Issue: pikasTech/HWLAB#803

Co-authored-by: HWLAB Agent <hwlab-agent@pikastech.local>
2026-06-04 11:17:18 +08:00
Lyon 10c03e6c32 fix(web): v0.2 unify Code Agent trace polling path + persist fail (HWLAB #802) (#806)
Follow-up to PR #798 (#795 final). PR #798 closed the total-timeout /
hard-cap issue, but left two residual code-path inconsistencies that
#802 captures:

- Submit path and refresh path used different trace-polling code:
  submitMessage called `pollRunnerTrace` + `waitForAgentResult` (a
  dual function pair from pre-#798), while hydrate() never subscribed
  to the running trace at all. After a page refresh, the user saw
  the cloud-api "running" state but no live trace events.
- The submit fail branch only dispatched a local "Code Agent 超时"
  message; it never called `persistConversation`, so the failure was
  invisible after F5 — the cloud-api conversation would show
  "running" forever from the user's perspective.

This PR collapses both into a single `subscribeToTrace` entry point
and wires the refresh path into the same active subscription:

- `state/runner-trace.ts` — replace `waitForAgentResult` +
  `pollRunnerTrace` with a single `subscribeToTrace(config)` that
  handles both the result endpoint and the trace endpoint in one
  `for(;;)` loop. Calls `onActivity` on EVERY successful poll (not
  just on new events) so the per-poll inactivity window in
  `fetchJson` does not fire on a healthy polling loop. Terminal
  status -> `onComplete`; 5xx -> keep polling, no activity; 4xx ->
  `onInfrastructureError`; `signal.aborted` -> silent return. The
  hard-cap / 4x / `TRACE_HARD_CAP_ATTEMPTS` machinery is gone (was
  already removed by #798).
- `state/trace-reattach.ts` — new `useTraceReattach` hook that
  subscribes to the running trace on hydrate (same `subscribeToTrace`
  call as submitMessage). Reuses an existing agent message slot for
  the traceId if one exists; otherwise creates a placeholder. Persists
  on both onComplete and onInfrastructureError. Path unification
  achieved: one entry, two callers.
- `state/workbench.ts`:
  - `submitMessage` calls `subscribeToTrace` directly with a
    single-line `onActivity: () => updateActivity()` plus
    `onComplete` / `onInfrastructureError` callbacks. The
    `onInfrastructureError` branch now ALSO calls
    `persistConversation`, persisting the fail state to cloud-api.
  - The re-attach useEffect is replaced with a one-liner
    `useTraceReattach({...})` call (workbench.ts stays under the
    400-line guard).
- `scripts/fetchJson-inactivity.test.ts` — third case tightened:
  200ms-cadence activity for 10s with `timeoutMs: 3000`; the
  request must live the full 10s and abort only after activity
  stops. Asserts `elapsed >= 10_000`.
- `docs/reference/spec-v02-hwlab-cloud-web.md` — the "Code Agent
  Timeout Model" section is renamed "Code Agent Timeout Model 与
  Path Unification" and now also pins: (a) `subscribeToTrace` is
  the only entry; `waitForAgentResult` / `pollRunnerTrace` /
  `TRACE_HARD_CAP_ATTEMPTS` MUST NOT exist; (b) `useTraceReattach`
  MUST be wired in; (c) `persistConversation` is required in both
  onComplete and onInfrastructureError; (d) `state.workspace.activeTraceId`
  changes MUST re-attach. Includes a distilled history of
  #775 / #777 / #791 / #795 / #797 / #798 / #802.

Verification
- `bun run scripts/tsc-check.ts` → strict React TSX, 0 explicit any
- `bun run check` → 5 pass / 0 fail (3 inactivity + 2 dist-contract)
- `bun run build` → 9 dist files verified fresh; `app.js`
  238460 → 240990 B
- `state/trace-reattach.ts` is now wired in; `state/runner-trace.ts`
  exports only `subscribeToTrace` (verified by tsc + grep)
- `workbench.ts` line count 400 (under the 400-line guard)
- New 200ms-cadence 10s test passes; old 100ms-cadence 2s test
  and total-timeout 200ms test still pass.

Refs: HWLAB #802, #795, #777, #791, #798

Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 11:08:20 +08:00