Commit Graph

75 Commits

Author SHA1 Message Date
Codex Agent 6cae643161 fix: remove legacy trace fallback paths 2026-06-06 13:55:03 +08:00
Codex Agent 1830df467e fix: unify AgentRun trace result authority 2026-06-06 13:08:23 +08:00
Codex Agent 4a22efb81a fix: detect whitespace-folded progress replies 2026-06-05 23:23:27 +08:00
Codex Agent fcd15b49d1 fix: trim message-only folded progress 2026-06-05 23:12:18 +08:00
Codex Agent d3ef88b58d fix: trim folded progress from agent conversations 2026-06-05 22:54:40 +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
Lyon 318df8597d fix: show inherited admin tool authority (#937)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-05 22:00:36 +08:00
Codex Agent a3ffd45e55 fix: enforce api key auth boundary 2026-06-05 21:58:16 +08:00
Lyon 2adc2f678f fix: restore bootstrap admin authority (#935)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-05 21:44:13 +08:00
Codex Agent 3e7131f6ab refactor: converge hwpod node-ops channel 2026-06-05 17:23:56 +08:00
Codex Agent d6769bf1d3 fix: remove v02 authorization residue 2026-06-05 14:00:13 +08:00
Lyon fc411b00f8 fix: remove legacy device pod grants authority (#906)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-05 12:02:51 +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
Lyon 6422487444 fix(v02): preserve owner conversation messages (#880)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-05 01:07:49 +08:00
Lyon 0c10056c22 fix(v02): rebuild terminal user messages (#878)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-05 00:41:06 +08:00
Lyon b6615c2abf fix(v02): preserve terminal workspace trace state (#874)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-05 00:00:04 +08:00
Lyon 1e085691e6 fix: repair persisted conversation snapshots (#855)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 20:59:10 +08:00
Lyon 6a79bc8f15 fix(v02): repair persisted final response fallback (#840)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 18:18:00 +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
Lyon 6c6a64b414 fix(v02): honor HTTP session cookie security (#831)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 16:59:15 +08:00
Lyon 7b2f4fa45f fix: wait for device-pod build verify output (#830)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 16:23:35 +08:00
Codex Agent baa7289ca0 fix(v02): widen device-pod job output visibility 2026-06-04 16:16:56 +08:00
Lyon 9928954ea6 feat: add device-pod build verify (#827)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 16:11:00 +08:00
Codex Agent 37f1b6af22 fix: support device-pod filename rg 2026-06-04 15:56:08 +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 0370135a35 feat(k8s+tests): keycloak bootstrap Job + AgentRun actor trace tests
- new deploy/k8s/keycloak/keycloak-bootstrap-job.yaml: one-shot Job that waits for Keycloak, authenticates as admin, creates hwlab realm + hwlab-cloud-web OIDC client via REST API
- secret hwlab-cloud-web-client holds the OIDC client_secret used by cloud-api
- kustomization.yaml picks up the new Job and Secret
- access-control.test.ts: cloud api AgentRun trace records real actor.userId from OIDC-upserted user (issue 788 spec)
- access-control.test.ts: cloud api /v1/users/me returns actor with authMethod=api-key for HWLAB_API_KEY Bearer token
- 31 pass / 4 pre-existing fail
2026-06-04 15:01:30 +08:00
Codex 84cca71bef feat(cloud-api): v0.2 OIDC login/callback (state, nonce, user upsert) 2026-06-04 15:01:30 +08:00
Codex 49dc7cc6e1 feat(cloud-api): v0.2 24h Web session + Secure cookie
- SESSION_MAX_AGE_SECONDS 7d -> 24h
- Cookie now sets Secure + SameSite=Lax (preserves HttpOnly)
- /v1/auth/session exposes authMethod, sessionExpiresAt, sessionTtlSeconds
- setSessionCookie/clearSessionCookie use new builders
- New test covers first-admin, /auth/login and /auth/logout cookie shape + expiresAt
2026-06-04 15:01:30 +08:00
Codex 13c779ed11 feat(cloud-api): v0.2 user API key auth (api_keys table + Bearer hwl_live_)
Adds the user API key foundation called out in #788:

- New api_keys table with idx_api_keys_user and idx_api_keys_prefix
- users extended with auth_provider/keycloak_issuer/keycloak_sub/email/last_login_at
- Authorization: Bearer hwl_live_... resolves to the same AuthPrincipal
- /v1/api-keys, /v1/api-keys/default, /v1/api-keys/{id}/regenerate, DELETE /v1/api-keys/{id}
- First-admin and /auth/login bootstrap a Default API key
- Short-test mode keeps display_secret; production化 will switch to hash-only later
- Legacy HWLAB_DEVICE_POD_API_KEY and Bearer <session-token> paths preserved
- 4 new access-control.test.ts cases

Refs pikasTech/HWLAB#788
2026-06-04 15:01:30 +08:00
Lyon f7e4c372ce fix(cloud): restore running session active trace (#811)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 12:18:08 +08:00
Lyon d5690ce2a5 fix(cloud): preserve selected conversation during terminal sync (#809)
Co-authored-by: Codex Agent <codex@hwlab.local>
2026-06-04 12:00:21 +08:00
Codex eb5bada0d1 fix(v0.2): device-pod output.text evidence read-only selectors for #773
Tracks pikasTech/HWLAB#773. PR #765 fixed selector confusion but did
not touch cloud-api evidence propagation. This change closes the
real root cause and adds the read-only evidence selectors that #760
follow-up called for.

cloud-api (internal/cloud/access-control.ts):
- DEVICE_JOB_INTENTS adds workspace.evidence and debug.evidence.
- DEVICE_JOB_READ_ONLY_SUB_ACTIONS = { status, output, wait, cancel,
  evidence } and DEVICE_JOB_ACTIONABLE_INTENTS = { workspace.build,
  debug.download } make the mutating-intent / sub-action matrix
  explicit.
- _deviceJobRequiresReason(intent, args, reason) returns false when
  the caller already provided reason OR when the actionable mutating
  intent is paired with a read-only sub-action. debug.reset and other
  non-actionable mutating intents still always require reason.
- executorOutputPayload now also surfaces output.summary,
  nestedOutput.summary, evidence.text, evidence.logTail and
  evidence.summary as body.output.text, so a dispatcher that
  includes the host logTail / buildSummary in its result becomes
  visible to the Code Agent without a separate bootsharp dance.

device-pod executor (cmd/hwlab-device-pod/main.ts):
- gatewayDispatchText also walks result.evidence.{text,logTail,
  summary}, dispatch.message (only when dispatchStatus=completed),
  dispatch.summary, result.summary and dispatch.buildSummary before
  falling back to JSON.stringify.
- deviceHostArgs maps workspace.evidence / debug.evidence to the
  host device-host-cli evidence subcommands.

device-host-cli (skills/device-pod-cli/assets/device-host-cli.mjs):
- new readJobEvidence(kindPrefix, requestedId, { tail, full,
  target }) reads the most recent (or specified) keil-build /
  keil-download job log file and returns it as keil-build.evidence /
  keil-download.evidence. tail defaults to 200, --full for entire
  log. Missing job returns ok=false but does not throw.
- workspace build evidence and debug-probe download evidence now
  wired in main() and help text.

device-pod-cli (tools/src/device-pod-cli-lib.ts):
- selectorCheatSheet adds the evidence row and clarifies that
  build/download status/output/wait/cancel/evidence are read-only
  and do NOT need --reason. build/download start still require
  --reason. usage examples now include the two evidence selectors.
- failed-fast selectors are unchanged; existing 26 tests still pass.

SKILL.md (skills/device-pod-cli/SKILL.md):
- Selector Cheat Sheet adds workspace.evidence and
  debug.evidence rows.
- #773 follow-up note: --reason is now required only for
  mutating sub-actions, not for the read-only ones.

cloud-api tests (internal/cloud/access-control.test.ts):
- workspace.evidence and debug.evidence must be in DEVICE_JOB_INTENTS.
- _deviceJobRequiresReason signature and the read-only / actionable
  branch table.
- executorOutputPayload must look at evidence and summary fields
  in addition to text. 3 new tests; pre-existing 4 workbench
  failures are unrelated to this change and reproduce on the
  unchanged v0.2 base.

Verification (host-side, G14 /root/hwlab-v02, source=0cf9a8c6):
- bun test tools/device-pod-cli.test.ts → 26/26 pass.
- bun test internal/cloud/access-control.test.ts → 23 pass,
  4 pre-existing workbench failures (unchanged on v0.2 base).
- bun test cmd/hwlab-device-pod/main.test.ts → 7/7 pass.
- node --check skills/device-pod-cli/assets/device-host-cli.mjs
  → syntax OK.

Hot probe: live v0.2 cloud-api at 74.48.78.17:19667 confirmed
job_devicepod_804c5db4... (workspace.build) returned
text="", bytes=0, output={} before this change. After the
executor text-extraction update and the new evidence selector,
a follow-up workspace.build start + build evidence will surface
the host logTail / buildSummary in body.output.text without
requiring bootsharp + host file fallback.

Tracked-by: pikasTech/HWLAB#773
2026-06-03 21:57:39 +08:00
Codex da25cb4c02 feat: align session sidebar and cli management 2026-06-03 09:47:52 +08:00
Codex 9f287fa0d9 fix: allow code agent workspace concurrency 2026-06-02 21:54:28 +08:00
Codex 39562d9c02 fix: clear stale continuation after thread resume failure 2026-06-02 20:12:01 +08:00
Codex bacfa24289 fix: replace device pod lease with api key 2026-06-02 18:11:32 +08:00
Codex 11dc7df502 fix: surface nested devicepod executor output 2026-06-02 15:03:41 +08:00
Codex 36e4ba2068 Merge remote-tracking branch 'origin/v0.2' into fix/v02-workbench-orphan-active-trace
# Conflicts:
#	docs/reference/spec-v02-hwlab-cloud-api.md
#	internal/cloud/access-control.test.ts
#	internal/cloud/server-agent-chat.test.ts
2026-06-02 12:13:50 +08:00
Codex 3497a8993b feat: support agentrun steer and idle continuation 2026-06-02 10:29:46 +08:00
Codex 48492ba267 fix: 释放孤儿 active trace 2026-06-02 08:55:10 +08:00
Codex 666395f056 fix: ignore stale workbench active trace 2026-06-02 08:35:12 +08:00
Codex da96f02333 fix: preserve AgentRun reuse mapping and trace rendering 2026-06-02 03:16:50 +08:00
Codex 66ffd2e171 fix: repair stale terminal workbench conversations 2026-06-02 02:45:00 +08:00
Codex bf2bdee5f6 fix: sync terminal workbench conversation 2026-06-02 02:25:29 +08:00
Codex 577622d0ab fix: sync terminal workbench traces 2026-06-02 01:55:19 +08:00
Codex 90f030e8f7 fix: release completed agentrun workspace turns 2026-06-02 00:50:20 +08:00
Codex 99aeb99991 fix(workbench): bind postgres workspace created timestamp 2026-06-01 22:00:16 +08:00
Codex 4691780b7a fix(workbench): type postgres workspace update role parameter 2026-06-01 21:54:02 +08:00