Skip to content

Bug: Codex toml_block position = "top" is ignored, nesting developer_instructions #52

Description

@e-q

On nono 0.64.1, the CLI WiringDirective::TomlBlock does not include a position field, and upsert_toml_block appends the block when no existing marker is present. If
~/.codex/config.toml ends inside a table such as [mcp_servers.foo], the appended bare key:

developer_instructions = """..."""

is parsed as:

[mcp_servers.foo]
developer_instructions = """..."""

rather than as root-level developer_instructions. Codex then does not receive the intended instructions.

Expected

toml_block with "position": "top" is honored, or root-level Codex keys are inserted before the first TOML table.

Actual

The block is appended, and root keys in the block can land in the previous table.

Minimal repro

model = "gpt-5"

[mcp_servers.filesystem]
command = "mcp-server-filesystem"

# appended by nono toml_block:
developer_instructions = """
hello
"""

Parsing this TOML places developer_instructions under mcp_servers.filesystem, not at the root.

Suggested fix

Teach the CLI toml_block directive to deserialize and honor a position field, with a regression test where config.toml ends in a table and the inserted
developer_instructions remains at root.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions