Repository navigation
[Feat/#69] 빌릴게 재고 도구를 백엔드 실데이터로 연결 - #70
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This was referenced Nov 16, 2026
seungbye
approved these changes
Nov 17, 2026
seungbye
left a comment
Contributor
There was a problem hiding this comment.
코드는 좋아요. 승인할게요 👍
- 토큰을 함수 인자가 아니라
ContextVar로 넘겨서 모델이 토큰을 아예 못 보는 구조가 좋아요 ENV=prod인데BACKEND_BASE_URL이 없으면 서버가 뜨지 않게 막은 것도 좋아요. 가짜 재고가 진짜처럼 나가는 것보다 낫다고 봐요
참고 (머지를 막을 정도는 아님)
_fetch_items가 동기httpx.get이고llm._run_tool도 async 함수 안에서 동기로 불려요. 백엔드가 느리면 최대 5초 동안 이벤트 루프가 멈춰서 그 사이 다른 학생 답변 스트림도 같이 멈춰요. 지금 동시 접속 규모에서는 괜찮지만, 도구가 늘어나면(#80)asyncio.to_thread로 빼는 걸 고려해 봐요
머지 시점
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.
#️⃣연관된 이슈
📝작업 내용
app.py:/chat이X-User-Token을 받아 그 요청 동안만 도구에 넘깁니다tools.py:_fetch_items()가BACKEND_BASE_URL로 백엔드를 부릅니다ContextVar(요청마다 따로 보관되는 변수)로 넘깁니다. 모델은 토큰을 볼 수 없습니다BACKEND_BASE_URL이 비어 있으면 기존 가짜 응답을 씁니다(로컬 개발·평가)ENV=prod인데 비어 있으면 서버가 뜨지 않습니다. 가짜 재고를 진짜처럼 보여주는 사고를 막습니다AGENTS.md계약에X-User-Token,.env.example·docs/guides/deploy.md에BACKEND_BASE_URL로컬 확인 (가짜 백엔드로 확인):
서버 로그에 토큰이 찍힌 횟수 0
💬리뷰 요구사항(선택)