Skip to content

Make config .json #195

Closed as not planned
Closed as not planned

Description

@enyst

@xingyaoww @csmith49 How do you feel about changing config.toml to .json, and then kill some redundancy?

At a minimum, it’d start being more consistent.

There are two reasons I can think of, why toml was/is useful:

  1. legacy / compatibility

    • but maybe we can take this opportunity to simplify at least some of that mess! We don’t keep all backwards compatibility with v0.
  2. toml format is easier to read/write directly by humans

    • on the other hand, with the agent, that’s not really a problem anymore, it can write a migration file for users, or a quick UI for them to modify values, even outside our “official” UIs.

Against toml:

  • .json is already here, easier to manipulate programmatically
  • specially to write to - libraries for toml exist, and we use one actually, but it’s no so straightforward as json
  • in v0 we maintain configs in two formats, simplifying is good!

Activity

  1. xingyaoww commented on Sep 10, 2025

    @xingyaoww
    Contributor

    I actually hope we can sort of get rid the concept of config in agent-sdk, and off load it to downstream applications -- this can probably help us get rid of our settings <-> config <-> cmd args <-> env var non sense 😭

  2. xingyaoww commented on Sep 10, 2025

    @xingyaoww
    Contributor

    (we already sort of did that since all the config classes are removed)

  3. csmith49 commented on Sep 10, 2025

    @csmith49
    Contributor

    And since most things are now pydantic BaseModel instances, JSON is a very natural config language. We can just .model_dump_json and .model_validate_json.

    If we do keep TOML in any capacity (but I'd be v happy getting rid of it), I would want to make a breaking change to how things are represented. Everything below the break is copied from some other discussion:


    One pain point I’ve always had about some of our config files: the way we use TOML makes it very difficult to map to structured configuration objects. E.g., we define multiple LLM configs like:

    [llm]
    …
    
    [llm.eval]
    …
    
    [llm.gpt]
    …
    

    And there’s a translation that turns this into a field that contains LLMs identified by llm, eval, and gpt.

    But that means LLM configs can’t easily have structured fields. For example, something like:

    [llm.security_setting]
    always_ask=True
    

    Requires some annoying compromises to get working:

    1. Don’t allow named LLMs identified by structured fields. Downside is that isn’t checkable without actually parsing the config and new fields can break old configs.

    2. Some brittle control-flow in the TOML-to-Pydantic translation that treats that field separately and might need to be updated whenever the config changes.

    For LLM config, this is a hypothetical problem, but it’s very real for condensers. The easiest fix is probably to avoid having any TOML conversion logic in the SDK and assume users will find a way to build the appropriate config objects, but if we wanted to keep support we could use TOML arrays instead. So the example above would look more like:

    [[llm]]
    name=”llm”
    …
    
    [[llm]]
    name=”eval”
    …
    
    [llm.security_setting]
    always_ask=True
    
  4. enyst commented on Sep 10, 2025

    @enyst
    MemberAuthor

    I can see why it doesn’t really belong to a SDK! I would think it’s on the edge, though, at least if we consider CLI and server two different downstream applications.

    I think it belongs at a framework level, shared by those two. Except we don’t have a framework level. 😅

    (One thing I think we need is named LLMs. Their configuration doesn’t have to be represented in a toml format, just represented somehow. Although… this one should be easy. 🤔)

    How do you see this:

    • CLI and server are two downstream applications
    • the user using both expects naturally to configure similar things, named the same way, at least on important things
    • but they share only sdk and tools dependencies?
  5. enyst commented on Sep 10, 2025

    @enyst
    MemberAuthor

    Ahaha. @malhotra5 just made this PR:

    That PR cuts out a “framework” level, in the sense above.

  6. xingyaoww commented on Sep 10, 2025

    @xingyaoww
    Contributor

    @enyst yeah, i'd imagine it would be a shared utility of "OpenHands application" and is out of the scope for agent sdk

  7. enyst commented on Sep 10, 2025

    @enyst
    MemberAuthor

    It would be useful to drop in the open the conclusions/plans you’re pursuing.
    It would probably help save us some time! 😅

  8. malhotra5 commented on Sep 10, 2025

    @malhotra5
    Member

    Yeah apologies! I didn't discuss the creation of the framework level types since it just happened spontaneously as I tried to develop the CLI using the agent-sdk

    We should def create a channel in Slack for these discussions so that its all done in the open, will make sure this happens shortly

  9. enyst commented on Sep 11, 2025

    @enyst
    MemberAuthor

    No worries at all, and thank you!

    Edited to add:
    It’s the wrong place for this issue, but I’d love your opinion on the .json config. If we can take the chance to simplify, I feel we could get rid of some unnecessary cruft.

  10. malhotra5 commented on Sep 11, 2025

    @malhotra5
    Member

    I would love to standardize on json!

  11. enyst commented on Sep 11, 2025

    @enyst
    MemberAuthor
  12. all-hands-bot commented on Jan 2, 2026

    @all-hands-bot
    Collaborator

    This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.

  13. all-hands-bot commented on Jan 13, 2026

    @all-hands-bot
    Collaborator

    This issue was automatically closed due to 50 days of inactivity. We do this to help keep the issues somewhat manageable and focus on active issues.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions