fix(qa): conversationKey dict→string 타입 불일치 수정 - #103
Merged
Conversation
agent 계약(docs/07-pi-agent-contracts.md)은 conversationKey를
\"${user_id}::${corp_code}\" 형식의 string으로 정의하지만,
backend가 dict를 전달해 agentHttpCore.ts 검증에서 에러 발생.
qa_routes.py: conversation_key 생성을 f-string으로 변경
agent_qa_runtime.py: 파라미터 타입 annotation을 str | None으로 수정
test_qa_routes_prior_turns.py: 테스트 assertion을 string 형식에 맞게 갱신
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GoBeromsu
added a commit
that referenced
this pull request
May 28, 2026
agent 계약(docs/07-pi-agent-contracts.md)은 conversationKey를
\"${user_id}::${corp_code}\" 형식의 string으로 정의하지만,
backend가 dict를 전달해 agentHttpCore.ts 검증에서 에러 발생.
qa_routes.py: conversation_key 생성을 f-string으로 변경
agent_qa_runtime.py: 파라미터 타입 annotation을 str | None으로 수정
test_qa_routes_prior_turns.py: 테스트 assertion을 string 형식에 맞게 갱신
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
GoBeromsu
added a commit
that referenced
this pull request
May 28, 2026
* fix(agent): QA plain-text 응답을 answerMarkdown fallback으로 처리
Solar/Pi가 잡담("안녕" 등) 질문에 free-form 자연어를 반환할 때
parseModeResult가 JSON.parse 실패로 throw하던 문제를 수정한다.
docs/07: "QA 출력: JSON 강제 없음" 계약에 따라 qa mode에서
JSON 파싱 실패 시 원문을 answerMarkdown으로 wrapping해 반환한다.
report/checklist_explanation은 기존 엄격한 JSON 계약을 유지한다.
- agent/src/agentModeParser.ts: qa 조기 분기 + plain-text fallback
- agent/test/agentServiceModeContract.test.mjs: 테스트를 올바른 계약 반영으로 갱신
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test(demo): QA step 4 견고화 및 multi-turn 확장
- /qa navigate 후 page.reload()로 DemoSessionProvider 재마운트 → qaStockOptions refetch
- select options waitForFunction으로 명시적 대기 후 삼성전자 선택
- input selector를 placeholder 의존에서 마지막 text input 방식으로 교체
- assistant 응답 도착 시그널을 body.innerText 길이 기반으로 강화 (90s timeout)
- 2턴째 질문(단기 위험 신호) 추가 및 응답 대기 적용
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(qa): conversationKey를 dict에서 string으로 수정 (#103)
agent 계약(docs/07-pi-agent-contracts.md)은 conversationKey를
\"${user_id}::${corp_code}\" 형식의 string으로 정의하지만,
backend가 dict를 전달해 agentHttpCore.ts 검증에서 에러 발생.
qa_routes.py: conversation_key 생성을 f-string으로 변경
agent_qa_runtime.py: 파라미터 타입 annotation을 str | None으로 수정
test_qa_routes_prior_turns.py: 테스트 assertion을 string 형식에 맞게 갱신
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* test(demo): QA input locator를 정확한 placeholder 매칭으로 강화
type+delay로 React onChange 트리거, placeholder 정확매칭으로 locator 안정화
---------
Co-authored-by: Claude Sonnet 4.6 <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.
Summary
backend/routes/qa_routes.py:104에서conversation_key를dict로 생성했으나, agent 계약(docs/07-pi-agent-contracts.md:219)은"${user_id}::${corp_code}"형식의 string을 요구함.agentHttpCore.ts의 string 검증에서 에러 발생.qa_routes.py:{"userId": ..., "corpCode": ...}→f"{user_id}::{effective_corp_code}"(1줄 변경)agent_qa_runtime.py: 파라미터 타입 annotationdict[str, str] | None→str | None(1줄 변경)test_qa_routes_prior_turns.py: dict 형식 assertion → string 형식 assertion으로 갱신 (3줄 변경)Test plan
pytest tests/test_pipeline_api.py -k qa→ 10 passedpytest tests/routes/test_qa_routes_prior_turns.py→ 5 passed (총 15 passed)agent npm run build→ exit code 0 (tsc 에러 없음)🤖 Generated with Claude Code