Commit Graph

317 Commits

Author SHA1 Message Date
Codex Agent 24657acd0c docs: 固化 CaseRun agent compile-only 决策 2026-06-06 14:29:21 +08:00
Codex Agent c58a7fff6c fix: 收敛公共 trace result 契约 2026-06-06 14:20:57 +08:00
Codex Agent 494d3ed3bb fix: add async CaseRun CLI controls 2026-06-06 14:00:18 +08:00
Codex Agent 352da4c436 fix: resolve hwpod node windows git command 2026-06-06 13:49:21 +08:00
Codex Agent 1830df467e fix: unify AgentRun trace result authority 2026-06-06 13:08:23 +08:00
Codex Agent 44a59d4f9e fix: orchestrate caserun agent flow without grading 2026-06-06 12:53:31 +08:00
Codex Agent 7f6007d53a docs: clarify CaseRun agent boundary 2026-06-06 12:42:33 +08:00
Codex Agent 4a4aa1bc29 feat: isolate CaseRun subject worktrees 2026-06-06 11:09:08 +08:00
Codex Agent 2a651d11d3 fix: migrate caserun registry to hwlab-case-registry 2026-06-06 10:11:46 +08:00
Codex Agent 7ddfffcd02 docs: rename caserun registry repo 2026-06-06 09:46:56 +08:00
Codex Agent 545b1dc892 docs: define caserun source repo boundary 2026-06-06 09:34:00 +08:00
Codex Agent 346be42b8d docs: record hwpod caserun current state 2026-06-06 09:01:01 +08:00
Codex Agent 8fae961c7c feat: add compile-only hwpod caserun 2026-06-05 23:35:56 +08:00
Codex Agent cc21ad40cb fix: enforce single hwlab api key env 2026-06-05 22:33:39 +08:00
Codex Agent a3ffd45e55 fix: enforce api key auth boundary 2026-06-05 21:58:16 +08:00
Codex Agent 2292ba5189 fix: migrate Keil hwpod compiler binding 2026-06-05 20:47:37 +08:00
Codex Agent 4179621538 docs: align provider profile cli spec status 2026-06-05 18:40:49 +08:00
Codex Agent 187f14681b docs: align provider management spec status 2026-06-05 18:26:36 +08:00
Codex Agent 210d7b6a7d docs: record v02 workspace first screen contract 2026-06-05 17:28:27 +08:00
Codex Agent 3e7131f6ab refactor: converge hwpod node-ops channel 2026-06-05 17:23:56 +08:00
Codex Agent 251988d235 docs: align v02 auth specs with hwpod authority 2026-06-05 16:21:04 +08:00
Codex Agent 00bccbb61a docs: add v02 provider management spec 2026-06-05 15:48:30 +08:00
Codex Agent 5c87936c7f docs: remove legacy auth residual gates 2026-06-05 14:59:11 +08:00
Codex Agent d6769bf1d3 fix: remove v02 authorization residue 2026-06-05 14:00:13 +08:00
Codex Agent 7157e59c48 docs: distill v02 access cleanup state 2026-06-05 13:19:22 +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 c8a8aa505e feat: add hwpod harness node-ops loop 2026-06-05 11:52:47 +08:00
Codex Agent ab7d79c69a feat: expose v02 webui performance metrics 2026-06-05 11:14:27 +08:00
Lyon 48e3d24ad6 fix: converge v02 authorization on OpenFGA (#899)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-05 11:11:15 +08:00
Codex Agent cf722efd06 feat: add v02 OpenFGA access management 2026-06-05 09:39:49 +08:00
Codex Agent dd914fbfb6 docs: record v02 observability validation rules 2026-06-05 09:27:11 +08:00
Codex Agent 57277da24c feat: add v02 observability metrics sidecars 2026-06-05 08:27:36 +08:00
Codex Agent 3ed0cdd773 docs: specify v02 observability monitoring integration 2026-06-05 07:49:14 +08:00
Codex Agent fd1b8c0e5a fix(v02): remove legacy code agent control plane 2026-06-05 01:35:35 +08:00
Codex Agent d6cd14f260 fix(v02): make cd latest-only 2026-06-04 22:45:37 +08:00
Lyon 758c26a448 fix: surface playwright fallback remediation (#852)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 20:55:21 +08:00
Codex Agent b896db85d4 docs: specify v02 PR auto CD workflow 2026-06-04 20:09:12 +08:00
Lyon ef527d3ecd feat(v02): add final response session verifier (#847)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 19:02:13 +08:00
Lyon d23cc410be fix(v02): bound cloud web layout smoke (#846)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 18:50:35 +08:00
Codex Agent e64ee92fb1 fix(v0.2): align Keycloak auth to HTTPS session API key 2026-06-04 15:01:30 +08:00
Codex Agent 683d7b7459 docs(v02): record Keycloak deployment baseline 2026-06-04 15:01:30 +08:00
Codex Agent e70dab1f88 fix(v02): wire Keycloak OIDC runtime 2026-06-04 15:01:30 +08:00
Codex Agent 52af835500 fix: unify v02 browser launcher 2026-06-04 14:51:54 +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
Lyon f7731d1421 fix(web): v0.2 remove all total-timeout / hard cap on Code Agent turn (HWLAB #795 final) (#798)
Follow-up to PR #797: drop every wall-clock or attempt-count ceiling from
`state/runner-trace.ts` so the Web UI's Code Agent inactivity-timeout
contract is total-cap-free. The previous PR kept a
`max(totalTimeoutMs * 4, totalTimeoutMs + 60s)` outer-loop safety net
plus a `TRACE_HARD_CAP_ATTEMPTS = 120` poll-count cap, which would
re-introduce the same regression class that #795 was filed against: a
long-running operation that keeps emitting trace events could still be
killed by the outer ceiling even with an active `activityRef`. The
"Code Agent Timeout Model" section of
`docs/reference/spec-v02-hwlab-cloud-web.md` now pins the contract:

- The sole abort signal is per-poll `fetchJson` inactivity-timeout,
  driven by `activityRef`.
- The outer `waitForAgentResult` / `pollRunnerTrace` loops are
  `for (;;)`. They only exit when the upstream returns a terminal
  status, the request fails with a non-5xx, or the inactivity window
  fires inside `fetchJson`.
- The per-poll `getAgentChatResult` call passes the full
  `totalTimeoutMs`; the inactivity window is **not** shrunk by
  wall-clock elapsed time.
- `TRACE_HARD_CAP_ATTEMPTS` and the 4x / +60s outer cap are deleted.
- Runaway protection is the caller's responsibility: Web users have
  cancel / steer / close-tab; CLI has `--timeout-ms`. The browser does
  not introduce an implicit cap.

Changes

- `web/hwlab-cloud-web/src/state/runner-trace.ts`:
  - Drop `const hardCapMs = Math.max(totalTimeoutMs * 4, totalTimeoutMs + 60_000)`
    and the `if (Date.now() - startedAt >= hardCapMs) break;` checks in
    both `waitForAgentResult` and `pollRunnerTrace`.
  - Replace `while (Date.now() - startedAt < hardCapMs)` with
    `for (;;)`. Drop the now-unused `startedAt` locals and the
    `let attempt = 0; attempt > TRACE_HARD_CAP_ATTEMPTS` guard.
  - Pass `totalTimeoutMs` directly to `api.getAgentChatResult` instead
    of `totalTimeoutMs - (Date.now() - startedAt)` so the per-poll
    inactivity window is stable.
  - Delete `const TRACE_HARD_CAP_ATTEMPTS = 120;` (no longer referenced).

- `web/hwlab-cloud-web/scripts/fetchJson-inactivity.test.ts`:
  - Replace the "1.5s cadence 6.5s" case with a stricter "200ms cadence
    10s" case: `timeoutMs=3000` inactivity window, continuous 200ms
    activity for 10s, then stop. Assert `elapsed >= 10_000` and that
    the abort is the inactivity-timeout error. This pins the
    `elapsed >= 10000` invariant in the spec.

- `docs/reference/spec-v02-hwlab-cloud-web.md`:
  - Strengthen the existing bullet in "在系统中的职责划分" to
    explicitly forbid total-timeout, hard cap, `codeAgentTimeoutMs * N`,
    poll-count cap, and wall-clock-shrunk per-poll windows.
  - Add a dedicated "Code Agent Timeout Model" section after "## 内部架构"
    that distils the contract, lists the three invariants, and records
    the history of #775 / #777 / #791 / #795 leading to the final state.

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` 241802 → 238460 B
  (delta reflects the deleted hardCap / TRACE_HARD_CAP_ATTEMPTS code)
- New 200ms-cadence 10s inactivity test runs for ~13s and asserts the
  request lives the full window — proving the outer cap is gone.

Refs: HWLAB #795 (final), #777, #791, #775

Co-authored-by: Codex <codex@local>
2026-06-04 09:36:29 +08:00
Codex b23ba1cb82 docs: unify v0.2 user api key auth 2026-06-04 01:06:36 +08:00
Codex f81aad7ace docs: clarify AgentRun session resume boundaries 2026-06-04 01:02:12 +08:00
Codex ac0a7e57d8 docs: add v0.2 auth spec 2026-06-04 00:47:15 +08:00
Codex 6341015d3b feat(v0.2): Code Agent 默认 sessionStorage=persistent + eviction reset UX
PR D for #770:HWLAB Cloud Web Workbench 透传 session state 真正持久化

- code-agent-agentrun-adapter.ts:
  * 新 ensureAgentRunSessionPersistent:默认 sessionStorage=persistent,
    调 POST /api/v1/sessions 同步建 session + PVC
  * submitAgentRunChatTurn 改两步尝试:ensureSession 或 runner-jobs POST
    收到 session-store-evicted 时用新 sessionId(<base>-reset-<trace8>)
    + threadId=null 重试,trace 追加 agentrun:session-reset 事件
  * 新 shouldResetSessionAfterEviction / newSessionIdAfterEviction 辅助函数
- code-agent-response-contract.mjs: session-store-evicted 归
  session-blocked category
- code-agent-chat.ts: 新 userMessage
  「Code Agent session 存储已失效(PVC 被回收或 TTL 到期),
   HWLAB 已为你开新 sessionId,可继续发送下一条消息。」
- spec-v02-hwlab-cloud-web.md: 新增 'Session state 持久化与 eviction reset'
  章节,含禁止路径与实现情况表

env 控制:HWLAB_CODE_AGENT_AGENTRUN_SESSION_STORAGE=ephemeral
可退回 metadata-only 模式(PR 前默认行为)。
2026-06-03 21:47:14 +08:00