From ecf321b1abc701681b3da1be65550b9cf59ff03e Mon Sep 17 00:00:00 2001 From: jsahn Date: Wed, 8 Jul 2026 16:06:50 +0900 Subject: [PATCH] refactor: make user_id a required input, drop hardcoded jsahn default user_id is now a required workflow_dispatch input (no default) and the runner validates it is non-empty before doing anything. Removed the 'jsahn' default from the script arg and replaced jsahn with placeholders throughout TEST_WORKFLOW.md so the workflow is not pinned to one account. Co-Authored-By: Claude Opus 4.8 (1M context) --- .gitea/workflows/run-agent.yml | 5 ++--- TEST_WORKFLOW.md | 10 +++++----- scripts/run_agent_api.py | 4 +++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/run-agent.yml b/.gitea/workflows/run-agent.yml index d4b62be1..4bf9e7ca 100644 --- a/.gitea/workflows/run-agent.yml +++ b/.gitea/workflows/run-agent.yml @@ -46,9 +46,8 @@ on: required: true type: string user_id: - description: 'AgentBackend user_id' - required: false - default: 'jsahn' + description: 'AgentBackend user_id (필수)' + required: true type: string workspace_name: description: '작업실 이름 (예: 팬아웃 테스트). GET /workspaces/lookup 으로 UUID 자동 해석' diff --git a/TEST_WORKFLOW.md b/TEST_WORKFLOW.md index 14dc2517..798fc81c 100644 --- a/TEST_WORKFLOW.md +++ b/TEST_WORKFLOW.md @@ -34,7 +34,7 @@ GITEA_TOKEN= `.env` 의 토큰을 읽어 `workflow_dispatch` 를 호출한다. **토큰을 화면에 출력하지 말 것.** ```bash -cd /Users/jsahn/Works/Liti-agent-Development +cd # 이 저장소 루트 set -a; . ./.env; set +a # .env 로드 ($GITEA_TOKEN) curl -s -X POST \ @@ -46,7 +46,7 @@ curl -s -X POST \ "inputs": { "yaml_path": "Case_02_Comparison_Research/YAML_Prompts/1. Stage_1/v.5/Stage_1_Part_1.yml", "workspace_name": "팬아웃 테스트", - "user_id": "jsahn" + "user_id": "" } }' # 성공 시 HTTP 204 (본문 없음) @@ -88,7 +88,7 @@ pip install httpx httpx-sse python scripts/run_agent_api.py \ --yaml-path="Case_02_Comparison_Research/YAML_Prompts/1. Stage_1/v.5/Stage_1_Part_1.yml" \ --workspace-name="팬아웃 테스트" \ - --user-id="jsahn" \ + --user-id="" \ --api-base="http://100.93.221.71:8800" \ --output-dir=agent_run_output ``` @@ -106,7 +106,7 @@ python scripts/run_agent_api.py \ | `yaml_path` | ✅ | — | 실행할 Agent YAML 의 repo 상대경로 | | `workspace_name` | △ | `""` | 작업실 이름 → `GET /workspaces/lookup` 으로 UUID 해석 | | `workspace_id` | △ | `""` | 작업실 UUID 직접 지정(override). 비우면 name 으로 해석 | -| `user_id` | | `jsahn` | AgentBackend user_id | +| `user_id` | ✅ | — | AgentBackend user_id (실행 계정) | | `user_input` | | `""` | Agent 에 전달할 user_input | | `start_stage_index` | | `0` | 시작 stage 인덱스 | | `api_base` | | `http://agent-backend:8000` | 내부 컨테이너 주소 (/api 접두사 없음) | @@ -116,7 +116,7 @@ python scripts/run_agent_api.py \ 작업실 이름↔UUID 목록 확인: ```bash -curl -s "http://100.93.221.71:8800/workspaces/lookup?user_id=jsahn" | python3 -m json.tool +curl -s "http://100.93.221.71:8800/workspaces/lookup?user_id=" | python3 -m json.tool ``` --- diff --git a/scripts/run_agent_api.py b/scripts/run_agent_api.py index 71a23bf4..2c8aeef3 100644 --- a/scripts/run_agent_api.py +++ b/scripts/run_agent_api.py @@ -340,6 +340,8 @@ class AgentRunner: def run(self) -> int: try: + if not self.user_id: + raise SystemExit("ERROR: user_id 를 지정해야 합니다 (--user-id).") self.resolve_workspace() self.upload() @@ -446,7 +448,7 @@ def parse_args() -> argparse.Namespace: p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) p.add_argument("--yaml-path", required=True, help="실행할 Agent YAML 경로 (repo 상대/절대)") p.add_argument("--api-base", default="https://legalpoc.eroomai.com/api") - p.add_argument("--user-id", default="jsahn") + p.add_argument("--user-id", default="", help="AgentBackend user_id (필수)") p.add_argument("--workspace-name", default="", help="작업실 이름. GET /workspaces/lookup 으로 UUID 해석 (workspace-id 미지정 시)") p.add_argument("--workspace-id", default="",