Remember super-admin envfile path and require surface conversation #683

Merged
weichen merged 6 commits from fix/svc-superadmin-envfile-surface-conv into main 2026-10-21 15:29:23 +00:00
Owner

Two leftover findings from the GenUI prod upgrade:

  1. svc.sh remembers only the absolute path of AGENT_SYSTEM_ENV_FILE as superadmin_envfile= (never the file content). After a one-time deploy/start/restart with that env var (0600, owner-only), bare restart and recover/watchdog forward it automatically. Empty AGENT_SYSTEM_ENV_FILE= clears the record.
  2. Backend #239 (gitlink 528e3a4): POST /api/surfaces creating a new surface requires the caller's own conversationId (empty → 400; missing/foreign → 404).

Why: prod restart/recovery needed a re-exported credential file, and an empty conversationId could create a project-less surface.
Evidence: task card .task/fix-svc-superadmin-envfile-surface-conv.md (same document as this description); 51 unittest OK; Backend #239 CI success.
Impact: svc agent launch/env registration; HTTP create-surface validation; Backend pin.
Refs: Backend #239.

Two leftover findings from the GenUI prod upgrade: 1. **svc.sh** remembers only the absolute path of `AGENT_SYSTEM_ENV_FILE` as `superadmin_envfile=` (never the file content). After a one-time deploy/start/restart with that env var (0600, owner-only), bare restart and recover/watchdog forward it automatically. Empty `AGENT_SYSTEM_ENV_FILE=` clears the record. 2. **Backend #239** (gitlink `528e3a4`): `POST /api/surfaces` creating a new surface requires the caller's own `conversationId` (empty → 400; missing/foreign → 404). Why: prod restart/recovery needed a re-exported credential file, and an empty conversationId could create a project-less surface. Evidence: task card `.task/fix-svc-superadmin-envfile-surface-conv.md` (same document as this description); 51 unittest OK; Backend #239 CI success. Impact: svc agent launch/env registration; HTTP create-surface validation; Backend pin. Refs: Backend #239.
weichen added 5 commits 2026-10-21 15:13:48 +00:00
Why: establish the authorized task workspace and its initial baseline.

Evidence: preserved precheck receipt in .task/fix-svc-superadmin-envfile-surface-conv.md; R0=d9e9c0560a2767539f4415b579adbeff86a22ba6.

Impact: task metadata only; the feature workspace starts at d9e9c0560a.

Refs: .task/fix-svc-superadmin-envfile-surface-conv.md
Auth-on agent services need super-admin credentials at every launch, but
svc only forwarded them from the current environment, and recover/watchdog
relaunch with a cleared environment, so a bare restart or recovery failed
closed. svc now records only the absolute path of AGENT_SYSTEM_ENV_FILE as
superadmin_envfile= after checking it is a regular, owner-only (0600) file
before stopping anything, and forwards that path when no explicit
credentials are set. An empty AGENT_SYSTEM_ENV_FILE clears the record. The
file content is never read, copied or printed.

Why: prod restarts and recovery required re-exporting AGENT_SYSTEM_ENV_FILE.
Evidence: agent-exec unit dev-svc-superadmin-envfile-persist (cursor, attempt 1, terminal=success); unittest test_svc_superadmin_envfile + test_svc_recover + test_svc_identity: 51 OK (1 skipped).
Impact: svc.sh agent launch and svc.env gain superadmin_envfile; docs/svc.md 4.2 note.
Refs: Dev task fix/svc-superadmin-envfile-surface-conv.
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: the card must state authorization, goals and unit receipts including the failed-unknown and authorized Backend rerun.
Evidence: agent-exec receipts under /tmp/svc-sa-surface-20261021.
Impact: task card only.
Refs: fix/svc-superadmin-envfile-surface-conv.
Co-authored-by: Cursor <cursoragent@cursor.com>
Move modules/backend to 528e3a4 (Backend #239), which rejects empty or
foreign conversationId when creating a surface via POST /api/surfaces.

Why: Dev must carry the Backend conversation-required fix.
Evidence: Backend #239 CI success at 954e744; agent-exec unit
dev-svc-superadmin-surface-backend-repin (cursor, authorized fresh rerun,
terminal=success).
Impact: documentation pin / gitlink only.
Refs: Dev task fix/svc-superadmin-envfile-surface-conv.

Co-authored-by: Cursor <cursoragent@cursor.com>
Record results, review and pin receipts on the task card
ci / svc-realcombo (pull_request) Successful in 4m36s
ci / test (pull_request) Successful in 9m59s
ci / test-pg (pull_request) Successful in 14m6s
965f520ee7
Why: the card must carry results, evidence and the authorized rerun receipts before closing.
Evidence: make evidence for svc unittest suite (51 OK, 1 skipped) on HEAD 3c0faf76.
Impact: task card only.
Refs: fix/svc-superadmin-envfile-surface-conv.
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen added 1 commit 2026-10-21 15:13:49 +00:00
Fold-close the task card before merge
ci / svc-realcombo (pull_request) Successful in 3m59s
ci / test (pull_request) Successful in 10m36s
ci / test-pg (pull_request) Successful in 14m55s
b3af918cb2
Why: close the task card inside its own PR so landing it needs no post-merge backfill or separate close PR.
Evidence: .task/fix-svc-superadmin-envfile-surface-conv.md -> .task/archive/fix-svc-superadmin-envfile-surface-conv.md; status 已完成(合入前闭合); PR #683 https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/683.
Impact: task metadata only; the card is archived within PR #683 and lands with its merge commit.
Refs: task.sh close --self
weichen merged commit 5a907f4294 into main 2026-10-21 15:29:23 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Dev#683