Nanobot TOML Configuration Support - February 7, 2026

Summary

Implemented comprehensive TOML configuration support for the nanobot AI assistant, enabling users to use .toml files instead of JSON with full comment support and better readability.

Key Achievements

✅ TOML Configuration Loader

  • Added support for ~/.nanobot/config.toml file
  • Automatic detection: prioritizes TOML over JSON
  • Maintains backward compatibility with existing JSON configs
  • Proper error handling for malformed TOML files

✅ Documentation Updates

  • Updated README.md with comprehensive TOML examples
  • Added comparison table: TOML vs JSON benefits
  • Included full configuration examples for both formats

✅ Example Configuration

  • Created config.toml.example with complete setup guide
  • Demonstrated custom OpenAI-compatible provider configuration
  • Showed multi-provider setup with Moonshot/Kimi support

✅ Repository Integration

  • Successfully rebased on latest upstream (HKUDS/nanobot)
  • Resolved merge conflicts with security hardening updates
  • Pushed changes to toml-support-merged branch

Technical Details

File Changes

  • Modified: nanobot/config/loader.py - Added TOML loading logic
  • Modified: README.md - Comprehensive documentation updates
  • Added: config.toml.example - Complete example configuration

Dependencies

  • Uses built-in tomllib (Python 3.11+) or tomli for older versions
  • No breaking changes to existing functionality

Usage Examples

Basic TOML Configuration

# LLM Providers
[providers.openrouter]
apiKey = "sk-or-v1-xxx"

# Agent Defaults  
[agents.defaults]
model = "anthropic/claude-opus-4-5"

Custom Provider Setup

# Custom OpenAI-compatible providers
[llm_providers.moonshot]
type = "openai-compatible"
apiKey = "your-moonshot-key"
apiBase = "https://api.moonshot.cn/v1"

Next Steps

  • Add unit tests for TOML loading functionality
  • Implement automatic JSON-to-TOML migration tool
  • Submit PR to upstream HKUDS/nanobot repository

This implementation complements the existing multi-modal support, A2A protocol, and enhanced reasoning features being developed in the nanobot ecosystem.


Report generated by: AI Assistant
Repository: zhangfuwen/nanobot
Branch: toml-support-merged