feat: MBA-44 LLM trace 경계 및 표시 보강 - #66
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 767f631d9e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| setLlmTraceLoading(true); | ||
| setLlmTraceError(false); | ||
| const response = await workflowApi.getWorkflowRunLlmTraces( |
There was a problem hiding this comment.
Reset trace state when switching runs
When the user opens another run after viewing one that had LLM traces, this effect starts the new request but leaves the previous llmTraces array in state until the request resolves. Because the summary immediately treats any non-empty llmTraces as authoritative, the new run can temporarily show the previous run's token totals, model breakdown, and costs; on slow trace requests this displays misleading observability data. Clear the trace state at the start of the effect or associate trace rows with the run id before using them.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 7e08bfb. LogDetail now clears llmTraces at the start of each run-specific trace request, and LogDetail.test.tsx covers switching runs while the next trace request is still pending so stale trace totals are not displayed.
변경 사항
organization_id결손은organization_id=NULL로 usage 저장을 허용하도록 호환성을 유지했습니다.llm_usage_logs.latency_mscolumn명을 ORM/DB/schema/document에서 일관되게 정리하고, 기존 오타 column을 rename하는 migration을 추가했습니다.permission.deniedaudit metadata에 policy/resource/required permission context를 보강했습니다.관련 이슈
Closes #59
변경 유형
테스트
검증한 명령:
python -m py_compile apps/shared/services/llm_usage_context.py apps/gateway/services/llm_service.py apps/workflow_engine/services/llm_service.py apps/shared/schemas/llm.py apps/shared/db/models/llm.py apps/shared/alembic/versions/f8a9b0c1d2e3_rename_llm_usage_latency_ms.pypython -m pytest apps/gateway/tests/api/test_permission_helpers.py apps/gateway/tests/api/test_workflow_llm_traces_api.py apps/gateway/tests/services/test_llm_usage_log_context.py apps/shared/tests/test_llm_usage_schema.py apps/shared/tests/test_audit_actions.py apps/log_system/tests/test_workflow_execute_audit.py -qpython -m pytest apps/gateway/tests/services/test_team_service_permissions.py apps/gateway/tests/services/test_llm_service_permissions.py -qnpm test -- LogTokenAnalysis.test.tsx --runnpx eslint app/features/workflow/components/logs/detail-components/LogTokenAnalysis.tsx app/features/workflow/components/logs/detail-components/LogTokenAnalysis.test.tsxrg '\batency_ms\b' apps docs -Sgit diff --check참고:
npx tsc --noEmit은 기존app/features/workflow/store/useWorkflowStore.test.ts타입 오류 3건으로 실패하며, 이번 변경 파일에서는 새 타입 오류가 확인되지 않았습니다.스크린샷 (UI 변경 시)