Repository navigation
experiment: explore_schema에 샘플 행 추가 (#366) - #368
Draft
seyoung4503 wants to merge 1 commit into
Draft
seyoung4503 wants to merge 1 commit into
seyoung4503 wants to merge 1 commit into
Conversation
The schema tool returned columns, declared keys and comments only, so stored value formats were visible to the model only through its own probe queries. Reuse ExplorerPort.sample_rows and the run_sql row table to append three sample rows, cutting long text. Sampling failure keeps the schema and logs a warning. run_sql output is unchanged and now locked by an exact test. Refs #366 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#️⃣ Issue Number
📝 요약(Summary)
explore_schema가 테이블을 설명할 때 샘플 행 3개를 같이 돌려줍니다. 지금까지는 컬럼 이름·타입과, DB에 선언돼 있으면 컬럼 설명·PK·FK만 돌려줘서 값이 저장된 형태(결측 표현, 날짜 형식, 대소문자 등)는 모델이 직접run_sql로 찾아야 했습니다.ExplorerPort.sample_rows(모든 DB 어댑터에 구현돼 있지만 호출처가 없던 메서드)를 사용합니다.run_sql의 결과 표 렌더링을render_row_table로 떼어 두 도구가 함께 씁니다.run_sql출력은 바이트 단위로 같으며, 정확한 출력을 고정하는 테스트를 추가했습니다(변경 전 코드에서도 통과 확인).베이스는 #321 브랜치(
12b81cd)입니다. v4 실행에 쓰인system_prompt.py·server.py·codex_mcp.py와 해시가 같아서, 이 PR은 샘플 행만 바뀐 단일 변경 비교입니다.실험 결과: 효과 없음
v4와 같은 프로토콜(gpt-6.2-sol high, Spider·BIRD 개발 20문항씩, 동시 2, 문항당 600초, Codex CLI 0.173.0)로 두 조건을 같은 시점(2026-12-06 09:35)에 실행했습니다. 기록:
~/workspace/benchmarks/codex-mcp-samples-20261206/12b81cd5618622explore_schema결과에서 샘플 행을 받았습니다(대조 0문항).결론: 샘플 행 3개는 이 개발 문항에서 실행 후 오답을 줄이지 않았습니다. 모델이 이미 필요한 값을
run_sql로 직접 조회하고 있었고(local041 중복 확인, local264 행 수 비교 등), 실패는 정보 부족보다 판단·기준 차이에서 나온다는 앞선 분석과 맞습니다. 제품(master)으로 옮기지 않고 기록용으로 둡니다.알려진 한계
describe_table이 정규화한 이름으로sample_rows를 호출하면 대소문자 차이로 실패할 수 있습니다. 이때는 스키마만 돌려주고 warning을 남깁니다.검증
--all-extras환경)tests/test_codex_mcp_benchmark.py의 기존 Black 위반 한 곳은 손대지 않음)💬 To Reviewers
효과가 없어 기록용 draft로 둡니다. 머지하지 않습니다.
🤖 Generated with Claude Code