Bot TAT is minted on every invocation (memory-only cache), causing 'TAT endpoint rate limited (HTTP 429)' for subprocess callers
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- authentication
Hướng nghiên cứu
Start with internal/credential/default_provider.go and internal/credential/tat_fetch.go, then inspect TenantTokenStore and the existing config tenant-access-token flow. Trace how tokens are resolved, stored, and rejected, and how endpoint 429 responses are mapped. Done means minted TATs can be reused securely across invocations and token endpoint throttling is distinguishable in JSON, including Retry-After when provided.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
For bot identity, lark-cli caches the minted tenant access token (TAT) only in process memory. When it is driven as a short-lived subprocess (one process per API call, which is the normal way scripts and agents use it), every invocation therefore mints a new TAT before making the actual OpenAPI call. Under modest, steady load this throttles the token endpoint, and the API call fails with:
{"type":"api","subtype":"rate_limit","code":429,"message":"TAT endpoint rate limited (HTTP 429)"}
The underlying OpenAPI call never runs, so the failure is not a 99991400 frequency-control rejection and carries no log_id. That makes it look like an unexplained OpenAPI rate limit to the caller.
Environment
- lark-cli v1.0.98 (also seen on v1.0.97), darwin-arm64, brand
lark - Bot identity (
--as bot), one self-built app - Several independent local tools invoke lark-cli for the same app, each call in a new process
Observed
- About 3–5% of calls (reads and writes alike) fail with the error above, even at 1–2 calls per minute in total for one tool.
- None of the failures include
log_id,retry_after_secondsor a99991400code. - Downgrading from v1.0.98 to v1.0.97 did not change the rate.
Where in the code
internal/credential/default_provider.go:resolveTATkeepstatResultin memory anddoResolveTATcallsFetchTATdirectly. The minted token is never written to or read fromTenantTokenStore.internal/credential/tat_fetch.go: an HTTP 429 from the token endpoint is mapped toAPIError{Subtype: rate_limit, Code: 429}with the message "TAT endpoint rate limited (HTTP 429)".TenantTokenStoreandconfig tenant-access-token settogether withLARKSUITE_CLI_TENANT_ACCESS_TOKEN_SOURCE=credential-storealready exist, but they only cover a token supplied externally.
Request
- Persist minted TATs across invocations: cache them in the existing secure store until shortly before
expires_in, and reuse them in later processes for the same app and account. Re-mint only on expiry, or when a call is rejected for an invalid or expired token. - Make token-endpoint throttling distinguishable in the JSON error, for example a stable
subtypeor field such assource: "tat_endpoint", so callers can tell it apart from an OpenAPI99991400without parsing message text. Includeretry_after_secondswhen the endpoint providesRetry-After.
Related: #2860 (the accounts token endpoint returns a plain-text 429 for the user-token refresh path).
- Ngôn ngữ chính
- Go
- Star
- 18.2k
- Fork
- 1.4k
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 18
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của larksuite/cli
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
domain/im
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug domain/doc
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
mail: all-ASCII draft bodies are hard-wrapped every 998 bytes, inserting newlines inside words and tagsCó thể đã có người làm @linye157 đã nhận 26 ngày trước. Đang mởdomain/mail
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
auth: a 429 from the Token Endpoint during refresh deletes a still-valid loginCó thể đã có người làm @linye157 đã nhận 26 ngày trước. Đang mởbug domain/auth domain/im
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
larksuite/cli#2869 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của larksuite/cli
Issue tương tự
-
Add Alice&BotĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
slavakurilyak/awesome-ai-agents#1048 ·
-
【文章自荐】本地 LLM 实测:GPU 推理速度与测量条件Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
eryajf/learning-weekly#235 ·
-
test_archive_is_downloaded_after_logout_login doesn't wait for the storage client after loginĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
list_issues and search_issues: inconsistent `fields` allow-lists (`html_url` rejected by list)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
github/github-mcp-server#3960 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày