fix: make user balance initialization idempotent - #19
Merged
Merged
Conversation
suguanYang
force-pushed
the
fix/wangbinqi/idempotent-user-balance-init
branch
3 times, most recently
from
May 11, 2026 11:10
eca0daf to
84d98fd
Compare
suguanYang
force-pushed
the
fix/wangbinqi/idempotent-user-balance-init
branch
from
May 11, 2026 11:14
84d98fd to
e66fa9e
Compare
suguanYang
added a commit
that referenced
this pull request
May 11, 2026
suguanYang
added a commit
that referenced
this pull request
May 12, 2026
EricNGOntos
added a commit
that referenced
this pull request
May 12, 2026
* fix: make user balance initialization idempotent (#19) * fix: optimize agentic rag evidence rendering and navigation * chore: fix ruff lint errors * fix: resolve typecheck errors for agentic orchestrator * docs: update AGENTS.md with current 3-phase agentic navigation and hydration logic * chore: test github flow skill --------- Co-authored-by: suguanYang <wangbinqi77@gmail.com>
This was referenced Aug 12, 2026
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
ON CONFLICT DO NOTHINGso concurrent requests do not emit duplicate-key error spansuser_balancesGET /billing/creditsrequests and verifies only one balance/grant/payment is createdVerification
uv run --package knowhere-api-app --group dev pytest apps/api/tests/contract/test_billing_contract.py -quv run --package knowhere-worker-app --group dev pytest apps/worker/tests/contract/test_parse_task_contract.py -quv run --group lint ruff check packages/shared-python/shared/services/billing/credits_service.py packages/shared-python/shared/services/billing/credits_sync_service.py apps/api/tests/contract/test_billing_contract.py