Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
fix(codex): support TOML fallback on Python 3.10
cyhcb2308a934e8
diff --git a/modules/agents/subagent_router.py b/modules/agents/subagent_router.pyindex 4f81293a7..fc9866e0a 100644--- a/modules/agents/subagent_router.py+++ b/modules/agents/subagent_router.py@@ -8,9 +8,12 @@ from pathlib import Pathfrom typing import Dict, Iterable, Optionaltry:- import tomllib-except Exception: # pragma: no cover- tomllib = None+ import tomllib as _toml_parser+except ModuleNotFoundError: # pragma: no cover+ try:+ import tomli as _toml_parser+ except ModuleNotFoundError: # pragma: no cover+ _toml_parser = Noneimport yaml@@ -235,12 +238,12 @@ def _parse_claude_agent_definition(path: Path) -> Optional[SubagentDefinition]:def _parse_codex_agent_definition(path: Path, source: str) -> Optional[SubagentDefinition]:- if tomllib is None:+ if _toml_parser is None:logger.debug("tomllib unavailable; cannot parse Codex subagent file %s", path)return Nonetry:- data = tomllib.loads(path.read_text(encoding="utf-8"))+ data = _toml_parser.loads(path.read_text(encoding="utf-8"))except Exception as e:logger.debug("Failed to parse Codex subagent definition %s: %s", path, e)return Nonediff --git a/pyproject.toml b/pyproject.tomlindex c8e41927a..b31810e45 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -36,6 +36,7 @@ dependencies = ["markdown_to_mrkdwn>=0.2.0","typing_extensions>=4.12.2","PyYAML>=6.0",+ "tomli>=2.0.1; python_version < '3.11'","flask>=3.0.0","lark-oapi>=1.4.0","sentry-sdk>=2.0.0",diff --git a/tests/test_subagent_router.py b/tests/test_subagent_router.pyindex 8b4e7cacc..608716561 100644--- a/tests/test_subagent_router.py+++ b/tests/test_subagent_router.py@@ -1,5 +1,6 @@from pathlib import Path+import modules.agents.subagent_router as subagent_routerfrom modules.agents.subagent_router import (list_codex_subagents,load_claude_subagent,@@ -119,3 +120,36 @@ def test_load_codex_subagent_reads_global_agent_definition(tmp_path: Path):assert definition.reasoning_effort == "low"assert definition.source == "global"assert definition.path == agent_file+++def test_parse_codex_agent_definition_uses_fallback_toml_parser(tmp_path: Path, monkeypatch):+ agent_file = tmp_path / "reviewer.toml"+ agent_file.write_text(+ '\n'.join(+ [+ 'name = "reviewer"',+ 'description = "Checks risks"',+ 'developer_instructions = "Focus on regressions."',+ ]+ ),+ encoding="utf-8",+ )++ class _FallbackParser:+ @staticmethod+ def loads(text: str):+ assert 'name = "reviewer"' in text+ return {+ "name": "reviewer",+ "description": "Checks risks",+ "developer_instructions": "Focus on regressions.",+ }++ monkeypatch.setattr(subagent_router, "_toml_parser", _FallbackParser)++ definition = subagent_router._parse_codex_agent_definition(agent_file, source="global")++ assert definition+ assert definition.name == "reviewer"+ assert definition.description == "Checks risks"+ assert definition.developer_instructions == "Focus on regressions."