Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: channel 레이어 쓰기 시 빈 channel_id 가드 추가
semantic_federation.py, org_setup.py 두 곳 모두 channel_id가 없는 상태에서
channel 레이어 등록 시도 시 명시적 에러 반환 (phantom 키 생성 방지)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
  • Loading branch information
thrcle and claude committed Jun 9, 2026
commit 1adafd4f6a435117fb73a5932a7c282d03bea1fd
8 changes: 8 additions & 0 deletions src/lang2sql/tools/org_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ async def run(self, args: dict[str, Any], ctx: "HarnessContext") -> ToolResult:
content="❌ 전사(guild) 용어 등록·초기화는 관리자만 가능합니다.",
is_error=True,
)

if layer == "channel" and not channel_id:
return ToolResult(
call_id="",
content="❌ 채널 컨텍스트 없이 팀(channel) 레이어에 등록할 수 없습니다.",
is_error=True,
)

entity = channel_id if use_team else ""
display_name = team_name if use_team else org_name
meta_key = (
Expand Down
7 changes: 7 additions & 0 deletions src/lang2sql/tools/semantic_federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ async def run(self, args: dict[str, Any], ctx: "HarnessContext") -> ToolResult:
is_error=True,
)

if layer == "channel" and not channel_id:
return ToolResult(
call_id="",
content="❌ 채널 컨텍스트 없이 channel 레이어에 등록할 수 없습니다.",
is_error=True,
)

entity = "" if layer == "guild" else (user_id if layer == "member" else channel_id)
key = _kv_key(term, layer, entity)

Expand Down
Loading