Skip to content

Enhancement/robust agent framework#16

Merged
arpan404 merged 8 commits into
mainfrom
enhancement/robust-agent-framework
Apr 12, 2026
Merged

Enhancement/robust agent framework#16
arpan404 merged 8 commits into
mainfrom
enhancement/robust-agent-framework

Conversation

@arpan404
Copy link
Copy Markdown
Owner

Sumary:

What's New

  • LLMProfile - Type-safe PROFILES (was dict of dicts)
  • Hedging Policy - Fire duplicate requests for tail latency
  • Circuit Breaker - Per-tool fault isolation
  • Interactive Debugger - Step-through breakpoints
  • Config Module - afk.config with env var resolution

What's Fixed

  • Import paths in docs (160+ instances)
  • RunnerConfig missing 18 fields
  • SandboxProfile missing 3 fields
  • Eval API names (EvalSuite → EvalSuiteConfig)
  • MCPServer constructor

What's Added

  • debugger.md - Debugger reference
  • queues.md - TaskQueue reference
  • environment-variables.md - Complete env var guide
  • Multi-provider routing docs
  • Per-provider API key patterns
  • 41 new config tests
  • 9 new debugger tests

…ll docs

- Fix cookbook-examples.md: correct import paths for FailSafeConfig, RunnerConfig
- Fix import errors: use afk.agents instead of afk.agents.types
- Fix RunnerConfig: add 18 missing fields (default_sandbox_profile, background tools, etc)
- Fix SandboxProfile: add file_allowed_extensions, file_max_size_mb, network_allowed_domains
- Fix Eval references: EvalSuite -> EvalSuiteConfig, use arun_suite()
- Fix MCPServer example: takes registry, not agent
- Add skill references to SKILL.md index
Before PROFILES was dict of dicts, not type-safe.
Now PROFILES uses LLMProfile dataclass with typed attributes.

Example:
  # Before (not type-safe)
  PROFILES[development][retry].max_retries  # error

  # After (type-safe)
  PROFILES[development].retry.max_retries  # ✓

Also exports LLMProfile from afk.llms module.
…variables

- debugger.md: Debugger, DebuggerConfig, debug instrumentation
- queues.md: TaskQueue system with TaskWorker, RetryPolicy, backends
- environment-variables.md: Complete reference for all AFK_* env vars including:
  - LLM settings with multi-provider routing
  - Memory backend configs
  - MCP server configs
  - Per-provider API keys and URLs
  - Multiple API keys pattern
- Update PROFILES access from dict-style to attribute-style
  PROFILES["development"]["retry"].max_retries
  -> PROFILES["development"].retry.max_retries
- Fix TestProfilesStructure to use hasattr/getattr instead of "in"
- Change TestLLMSettingsFromEnvInvalidValues: tests now verify
  fallback behavior (not raise), matching LLMSettings.from_env()
  forgiving design
Add afk.config module with:
- EnvVarField descriptor for type-safe env var binding
- Settings base class with from_env() auto-resolution
- LLMEnv, MemoryEnv, MCPEnv, QueueEnv for each subsystem
- Support for AFK_LLM_PROVIDER_ORDER for fallback chain

This enables:
  class LLMEnv(Settings):
      AFK_LLM_API_KEY = EnvVarField("AFK_LLM_API_KEY", default=None)

  config = LLMEnv.from_env()  # resolves all AFK_LLM_* vars
Add comprehensive tests for:
- DebuggerConfig defaults and custom values
- Frozen dataclass behavior
- All verbosity levels (basic, detailed, trace)
- Debugger.runner() creates debug-enabled runners
- Debugger with custom config merges correctly
- Integration test: disabled debugger emits no debug payload

Total: 11 tests (was 2)
…lm_client

- Add all runtime policies as explicit params to create_llm_client
- hedging_policy, circuit_breaker_policy, etc. can now be passed directly
- Update environment-variables.md with hedging and circuit breaker docs

Example:
  client = create_llm_client(
      provider="openai",
      hedging_policy=HedgingPolicy(enabled=True, delay_s=0.1),
  )
- Add BreakpointConfig for step-by-step debugging
- Add breakpoints support for pausing execution
- Expand test coverage to 11 tests
@arpan404 arpan404 merged commit 957005a into main Apr 12, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant