From 45f9c82d2cc20bf5ee409d34a31d44696499dae3 Mon Sep 17 00:00:00 2001 From: happybell80 Date: Mon, 29 Sep 2025 16:10:12 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B3=B4=EC=99=84=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80:=20root=5Fpath,=20pexpect=20=ED=8C=A8?= =?UTF-8?q?=ED=84=B4/=ED=83=80=EC=9E=84=EC=95=84=EC=9B=83,=20=EC=84=B8?= =?UTF-8?q?=EC=85=98=20=ED=8C=8C=EC=9D=BC=20=EA=B6=8C=ED=95=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - FastAPI root_path='/multi-ai' 설정 명시 - 각 CLI별 프롬프트 패턴 및 타임아웃 값 추가 - 세션 파일 권한 600 설정 명시 --- ideas/250929_happybell80_multi_ai_cli_integration.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ideas/250929_happybell80_multi_ai_cli_integration.md b/ideas/250929_happybell80_multi_ai_cli_integration.md index 4904277..a76acb2 100644 --- a/ideas/250929_happybell80_multi_ai_cli_integration.md +++ b/ideas/250929_happybell80_multi_ai_cli_integration.md @@ -126,6 +126,10 @@ tmux attach -t ai-panel - **인터페이스**: healthcheck() | ask()->async iterator | cancel() | resume() - **모드**: PTY/STDIO 모드 지원 - **정규화**: ANSI 제거, 프롬프트 재출현, 타임아웃 규칙 내장 +- **pexpect 패턴**: + - Claude: "❯" 프롬프트, timeout=30 + - Gemini: ">" 프롬프트, timeout=25 + - Codex: ">>>" 프롬프트, timeout=20 ### 파싱 규칙 - **종료 판단**: 프롬프트 패턴 + 침묵 타임아웃 + 길이 상한 @@ -142,6 +146,10 @@ tmux attach -t ai-panel - **세션 파일 위치**: strace/fs_usage로 CLI가 읽는 파일 추적 - **인증 오류 감지**: "Session expired", "Please log in" 패턴 매칭 - **헬스 체크**: claude me, gemini whoami로 세션 상태 확인 +- **세션 파일 권한**: + - ~/.config/claude: 600 (user read/write only) + - ~/.config/gemini: 600 (user read/write only) + - ~/.config/codex: 600 (user read/write only) ### 입출력 제어 - **pexpect 사용**: pty 모듈보다 안정적, 패턴 매칭 우수 @@ -188,6 +196,7 @@ tmux attach -t ai-panel ### 51123 nginx 프록시 - location /multi-ai/ → proxy_pass http://51124:8888/ - WebSocket 지원 헤더 설정 필요 +- root_path 프리픽스 설정: FastAPI(root_path="/multi-ai") ## 실현 가능성 평가