Skip to content

ROADMAP-19 — P2 — AGENTS.md compliance cleanups (os.getenv, silent suppress, hardcoded retry-after, arg leakage) #111

Open

Description

@getdownandcode

Series: ROADMAP — filed from the 2026-10-27 whole-project assessment · Backlog task: M16-T06 · Priority: P2 · Effort: small

Problem

Four places drift from the project's own AGENTS.md rules:

  1. openai.py reads os.getenv("OPENAI_API_KEY") directly, bypassing agentkit/config.py (rule: all configuration via Settings)
  2. Trace recording is wrapped in contextlib.suppress(Exception) with no log — swallow-without-logging contradicts the "never swallow silently" rule
  3. retry_after=60 hardcoded in the OpenAI 429 mapping instead of a settings member
  4. failure_reason embeds raw tool arguments (agent.py:358) — prompt-ish content leaks into a client-visible field, while the codebase elsewhere keeps goals out of INFO logs

Evidence

  • agentkit/llm/openai.py:37; agentkit/openai mapping :129
  • agentkit/core/agent.py:394–395 (suppress), :358 (args in failure_reason)

Suggested fix / acceptance criteria

  • Both adapters build from Settings only; factory passes explicit keys
  • Trace failure logged (WARNING, run_id/step_no) then continues
  • RETRY_AFTER_FALLBACK_S (or equivalent) setting used
  • failure_reason carries tool name + error category, not argument text (test pins this)

Suggested branch / commit

fix/agents-md-deviations · fix: align agent/llm code paths with AGENTS.md rules

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions