Skip to content
This repository was archived by the owner on Mar 18, 2026. It is now read-only.

Commit 6f0cbfc

Browse files
docs: Update PLAN.md and QUESTIONS.md with Hiro API rate limit details
Co-authored-by: aider (openrouter/x-ai/grok-4) <aider@aider.chat>
1 parent 5a570b9 commit 6f0cbfc

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

docs/PLAN.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,11 @@ This plan addresses performance issues in the aibtcdev-cache system under bursty
4646
- Add HIRO_API_KEYS to wrangler.toml.
4747
- Test with 30+ mixed requests; verify metrics in logs.
4848
- Deploy to staging, integrate with frontend for real-world testing.
49+
50+
## Additional Enhancements
51+
### Integrate Hiro Rate Limit Headers
52+
- Update StacksApiService to parse response headers (e.g., x-ratelimit-remaining-stacks-minute, ratelimit-remaining) after API calls.
53+
- Use headers to dynamically adjust TokenBucket (e.g., sync available tokens with remaining counts, respect retry-after).
54+
- Log header info for monitoring.
55+
- Align with migration timeline: Use new headers from August 1, 2024; remove legacy support after September 1, 2024.
56+
- Focus on Stacks-specific headers since this project primarily uses Stacks endpoints.

docs/QUESTIONS.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Open Questions and Tasks for AIBTCDEV Cache Update
22

3-
## Open Questions
4-
- Should src/utils/clarity-responses-util.ts be added to the chat for precise updates to clarity value handling in the Worker's fast-path? (Currently referenced but not edited.)
5-
- Are there specific Hiro API rate limits (e.g., paid tier) that need config adjustments beyond defaults?
6-
- How should error handling for key assignment failures (e.g., hash mismatch) be implemented in ContractCallsDO?
3+
## Resolved Questions
4+
- Should src/utils/clarity-responses-util.ts be added to the chat for precise updates to clarity value handling in the Worker's fast-path?
5+
**Resolution**: Yes, and it has been added to the chat.
6+
- Are there specific Hiro API rate limits (e.g., paid tier) that need config adjustments beyond defaults?
7+
**Resolution**: Limits are 500 RPM, but requests should be spaced evenly. New response headers are available for dynamic rate limiting (details in PLAN.md).
8+
- How should error handling for key assignment failures (e.g., hash mismatch) be implemented in ContractCallsDO?
9+
**Resolution**: Handle with specific ApiError messages, similar to other errors in the system.
710

811
## Tasks
912
- Add HIRO_API_KEYS as a secret in wrangler.toml (e.g., "key1,key2,key3,key4,key5").

0 commit comments

Comments
 (0)