Release 2.9.9: 오케스트레이터 버그 수정 + 로컬 터미널 프로젝트 동기화
- 오케스트레이터 auto-trigger 경로에 !isCodeAiSession/!isProjSession 누락 수정 (code_ai_ 세션에서 tool failure 쌓이면 memory_read 등 엉뚱한 도구 호출로 멈추던 문제) - 로컬 셸 시작/프로젝트 전환 시 프로젝트 폴더로 자동 cd - companion.py: shell_ready에 platform/home 정보 포함 - Windows/Unix 경로 처리: cd /d "경로" vs cd "경로" - localTermPath 미설정 시 companionHome fallback, 둘 다 없으면 cd 안 함 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+20
-1
@@ -492,6 +492,8 @@ let companionWs = null;
|
||||
let companionConnected = false;
|
||||
const COMPANION_URL = 'ws://127.0.0.1:9000';
|
||||
let companionShellId = null; // code terminal shell ID backed by companion PTY
|
||||
let companionPlatform = 'unix'; // 'windows' | 'unix', set on shell_ready
|
||||
let companionHome = ''; // home directory from companion
|
||||
const localShellIds = new Set(); // shell IDs routed to companion instead of server PTY
|
||||
|
||||
function companionConnect() {
|
||||
@@ -528,7 +530,12 @@ function handleCompanionMessage(msg) {
|
||||
setTimeout(() => {
|
||||
const s = codeTermShells.find(s => s.id === targetId) || codeTermShells.find(s => s.id === activeCodeTermShellId);
|
||||
if (!s || !s.term) return;
|
||||
if (msg.type === 'shell_ready') s.term.write('\x1b[32m🖥️ 로컬 셸\x1b[0m\r\n');
|
||||
if (msg.type === 'shell_ready') {
|
||||
if (msg.platform) companionPlatform = msg.platform;
|
||||
if (msg.home) companionHome = msg.home;
|
||||
s.term.write('\x1b[32m🖥️ 로컬 셸\x1b[0m\r\n');
|
||||
_companionCdProject();
|
||||
}
|
||||
else if (msg.type === 'shell_output') s.term.write(msg.data);
|
||||
else if (msg.type === 'shell_exit') { s.term.write(`\r\n\x1b[33m[셸 종료 ${msg.code}]\x1b[0m\r\n`); companionShellId = null; }
|
||||
else if (msg.type === 'started') s.term.write(`\r\n\x1b[32m▶ ${msg.filename}\x1b[0m\r\n`);
|
||||
@@ -543,6 +550,17 @@ function companionKill() {
|
||||
if (companionWs && companionConnected) companionWs.send(JSON.stringify({ type: 'kill' }));
|
||||
}
|
||||
|
||||
function _companionCdProject() {
|
||||
if (!companionConnected || !companionWs || !activeProjectName) return;
|
||||
const isWin = companionPlatform === 'windows';
|
||||
const sep = isWin ? '\\' : '/';
|
||||
const base = (localTermPath || companionHome || '').replace(/[/\\]$/, '');
|
||||
if (!base) return; // 경로 정보 없으면 cd 안 함
|
||||
const target = base + sep + activeProjectName;
|
||||
const cmd = isWin ? `cd /d "${target}"\r` : `cd ${JSON.stringify(target)}\r`;
|
||||
companionWs.send(JSON.stringify({ type: 'input', data: cmd }));
|
||||
}
|
||||
|
||||
function csbCodeDirChanged(val) {}
|
||||
function csbCodeDirSave() {}
|
||||
function csbLoadCodeDir() {}
|
||||
@@ -3645,6 +3663,7 @@ function switchProject(name) {
|
||||
updateLocalModeUI();
|
||||
updateSessionPanel();
|
||||
codeSbRefresh();
|
||||
if (companionShellId) _companionCdProject();
|
||||
// 채팅 패널 갱신: 히스토리가 있으면 그대로, 없으면 세션 목록
|
||||
const _msgs = document.getElementById('code-ai-messages');
|
||||
if (_msgs) {
|
||||
|
||||
Reference in New Issue
Block a user