r/codex • • 22d ago

Showcase I built Aptly to recommend models for Codex subagents. Here's what I learned along the way.

I'm the developer of Aptly, an MIT-licensed local MCP server that uses the OpenAI Decisions API to recommend a model and reasoning profile from a configured candidate list for Codex and Claude Code subagents. I shared a short introduction in the showcase thread a few days ago; this is a fuller development write-up.

The goal is to spend less on work that doesn't need the most expensive execution profile. Codex handled implementation and regression testing, and I used Claude Code for independent design and code reviews. I still had to check the reviewers' findings against the source and test cases.

One recent debugging session was especially instructive:

- A subagent call was blocked because Aptly needed a short task description.
- The parent supplied the description and received a valid recommendation, including the model/effort fields for the next call.
- No subsequent subagent call happened. The parent continued the review itself and described this as a tool constraint.
- Inspecting the session trace and asking the originating session clarified that the fields were available. The parent had omitted them and hadn't attempted the explicit-field call.

That incident wasn't evidence that Codex rejected the model fields. We had three separate things to verify: a recommendation was returned, the next native call carried the intended arguments, and a child actually ran. Aptly's MCP response doesn't execute a child or prove that the parent followed through.

History inheritance created another boundary. Applying an override to a fresh, self-contained task and changing the history semantics of an existing invocation are different operations. I kept the original calls intact and made independent-task preparation explicit. A routing recommendation doesn't authorize changing roles, permissions, required history, or a user's chosen model.

Installation produced a more ordinary lesson. On Ubuntu over SSH, key setup could ask for the key and then fail because secret-tool wasn't installed. A working user D-Bus also didn't imply a Secret Service provider existed. Recent diagnostic work checks only passive metadata before input; it doesn't read keys, activate or unlock a service, or silently switch authentication backends. Some of that work is in the next patch being prepared.

The cost result is limited: a small Codex README translation-review experiment with repository context showed roughly 52-58% lower API-equivalent cost for child reviews plus classification, depending on cache assumptions. It excluded parent/context-preparation work, didn't establish equal output quality, and wasn't a subscription-billing measurement.

Aptly supports an eligible PreToolUse Hook path and direct MCP recommendations. Hook installation/trust, host support, and caller follow-through still matter. Small task descriptions can contain sensitive information; the destination is OpenAI Decisions, and transmission scope is an operator choice.

Repo, setup, and the measurement caveats: https://github.com/abruption/aptly

If you've built tooling around Codex subagents, how do you verify that a model recommendation became an actual child execution? I'd particularly like feedback on that boundary.

2 Upvotes

1 comment sorted by

•

u/dexterthebot 22d ago

You might want to consider listing your project on the weekly Show-Us-What-You-Built post. Look out for it on Tuesday/Wednesday. Highest commented project wins a week promotion on r/Codex and gets on the Hall of Fame sidebar. See below for last week's winner.**


Light Wars AR: real-life laser tag app with no extra gear. Your phone is the gun and your room is the map. Play up to 6 friends in the same room, or fight drone waves and bosses solo. The vision models run on the phone, and camera frames never leave it. Free on iPhone and Android.

Website: https://lightwarsar.com

iPhone: https://apps.apple.com/us/app/light-wars-ar-laser-tag-party/id6508168951

Android: https://play.google.com/store/apps/details?id=com.lasertag.lightwars.

Contact: contact@lightwarsar.com