Skip to content

Conversation

@youming-ai
Copy link

@youming-ai youming-ai commented Feb 12, 2026

Summary

Add support for TOML configuration files as an alternative to JSON/JSONC. Config files are now detected with priority: .jsonc > .json > .toml

Closes #1782

Changes

  • Add smol-toml dependency for TOML parsing
  • Create toml-parser.ts with parseToml, parseTomlSafe, readTomlFile
  • Create config-detector.ts with unified detectConfigFile and parseConfigContent
  • Update plugin-config.ts to support TOML format
  • Update doctor checks to validate TOML configs
  • Fix migrateConfigFile to skip file write for TOML (in-memory migration only)

Usage Example

# oh-my-opencode.toml

[agents.sisyphus]
model = "anthropic/claude-opus-4-6"
temperature = 0.1

disabled_hooks = ["comment-checker"]

[claude_code]
enabled = true

Test Plan

  • Unit tests for TOML parsing (toml-parser.test.ts - 17 tests)
  • Unit tests for config detection (config-detector.test.ts - 7 tests)
  • Typecheck passes
  • Build succeeds
  • All related tests pass (125 tests)

Summary by cubic

Add TOML config support alongside JSON/JSONC with detection order: .jsonc > .json > .toml. Unifies parsing/validation across formats and runs migrations in-memory for TOML; closes #1782.

  • New Features
    • TOML parsing via smol-toml with parseToml/parseTomlSafe/readTomlFile, plus unified detectConfigFile and parseConfigContent.
    • Plugin loading, doctor checks, and model-resolution config now handle TOML; migrations skip file writes for TOML (in-memory only).

Written for commit 6fc5ff5. Summary will update on new commits.

Add support for TOML configuration files as an alternative to JSON/JSONC.
Config files are now detected with priority: .jsonc > .json > .toml

Changes:
- Add smol-toml dependency for TOML parsing
- Create toml-parser.ts with parseToml, parseTomlSafe, readTomlFile
- Create config-detector.ts with unified detectConfigFile and parseConfigContent
- Update plugin-config.ts to support TOML format
- Update doctor checks to validate TOML configs
- Fix migrateConfigFile to skip file write for TOML (in-memory only)

Closes code-yeongyu#1782
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6fc5ff5f68

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +115 to +117
if (format === "toml") {
log(`Skipping file write for TOML config (migrations applied in-memory): ${configPath}`)
writeSucceeded = false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip backup creation when TOML migrations aren't written

In the format === "toml" branch we skip writing the migrated config, but the backup copy has already been created earlier in the same needsWrite block. Because TOML migrations are in-memory only, the next startup will hit the same migration path again and create another timestamped .bak file, so users with migratable TOML settings can accumulate unbounded backup files and extra I/O on every run.

Useful? React with 👍 / 👎.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 15 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Substantial config system changes (552 lines, 15 files) affecting core loading/migration logic. Adding TOML support requires careful validation of backward compatibility and edge cases in config file.

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.

Feature: Add TOML config file support

1 participant