Repository navigation
Closed
Labels
priority/p2-mediumPriority P2: standard workscope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/docsType docs: a change to the documents
Milestone
Description
Problem Statement
AI agents (Claude, Copilot, Cursor, Codex) interacting with external APIs (GitHub REST/GraphQL, LLM inference endpoints, container registries, Valkey/Qdrant, and remote observability backends) can encounter HTTP 429 Too Many Requests, secondary rate limits, or GraphQL node/complexity exhaustion during high-frequency operations, batch scans, and multi-step reviews. Currently, AGENTS.md and src/devops_cli/ai/instruction_generator.py lack explicit instructions directing AI agents to proactively inspect, respect, and adapt to API rate limits.
Proposed Architectural Solution
- Update
AGENTS.mdwith explicit policies and operational guidelines for honoring API rate limits:- Proactive Rate Limit Inspection & Budgeting: Instruct agents to monitor rate limits (
gh api rate_limit,x-ratelimit-remaining,x-ratelimit-reset, HTTP 429,Retry-After). - GraphQL vs REST Adaptive Fallback: Fall back gracefully from complexity-constrained or rate-limited GraphQL queries to targeted REST API endpoints.
- Exponential Backoff with Jitter: Avoid tight busy-waiting retry loops; respect reset windows and back off dynamically.
- Batching & Caching: Maximize local cache utilization (
.data/, Valkey) and batch requests to minimize external roundtrips. - LLM Token & Concurrency Rate Limits: Honor token-per-minute (TPM) and request-per-minute (RPM) quotas, adaptive batching, and semaphore-bounded concurrency.
- Proactive Rate Limit Inspection & Budgeting: Instruct agents to monitor rate limits (
- Synchronize
src/devops_cli/ai/instruction_generator.pyso newly scaffolded agent instructions inherit rate limiting rules. - Validate all documentation and test suites with
devops docs checkand targeted tests.
Acceptance Criteria
-
AGENTS.mdupdated with dedicated rate limit guidelines under Section 1 (Engineering Philosophy) and Section 3 (GitHub & Remote API Integration). -
src/devops_cli/ai/instruction_generator.pyupdated to match canonical instructions. - Unit tests in
tests/test_instruction_generator.pyupdated and passing. - Full
devops docs checkpasses with zero drift.
Metadata
Metadata
Assignees
Labels
priority/p2-mediumPriority P2: standard workscope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/docsType docs: a change to the documents
Type
Projects
- StatusShow more project fieldsDone
Activity
docs(agents): update agent instructions to honor API rate limits and …
docs(agents): update agent instructions to honor API rate limits and …
feat(release): v0.2.16 (#161)