PUP-583: Gate codex-imagegen skill on Codex OAuth, add namespace tags - #749
Merged
mpfaffenberger merged 1 commit intoAug 11, 2026
Conversation
The codex-imagegen skill was always registered regardless of auth state, even though the codex_imagegen tool it teaches the model to call is already gated on Codex OAuth (_advertise_imagegen_tool returns [] when logged out). This let a model activate the skill, try the tool call, and only then discover auth was missing. - Gate _register_imagegen_skill() the same way _advertise_imagegen_tool already is: unauthenticated -> skill doesn't register at all. - Call refresh_skill_cache() after both the /codex-auth login flow and the logout flow, so the skill appears/disappears immediately instead of requiring a process restart -- mirroring the existing agent reload that already does this for the tool side. - Added tags to IMAGEGEN_SKILL.md's frontmatter (image-generation, codex, gpt-image, artwork). It previously had none, which meant it fell into namespace_skill_search's generic 'General' namespace alongside every other untagged skill.
WSxDemise
approved these changes
Aug 11, 2026
mpfaffenberger
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: PUP-583
What
Two related fixes to the built-in
codex-imagegenskill (chatgpt_oauthplugin):Why
codex_imagegen(the tool) was already gated on auth via_advertise_imagegen_tool:But
codex-imagegen(the skill) was registered unconditionally via_register_imagegen_skill, with no equivalent check. An unauthenticated user could still see the skill in/skills listand the namespace directory,activate_skillit, and get instructions telling the model to callcodex_imagegen(...)-- a tool that isn't actually wired into any agent for them. The skill's own content already anticipates this ("If authentication is missing, tell the user to run/codex-auth"), but that's a reactive fallback that only works if the model correctly diagnoses the failed tool call, not a proactive fix.Separately: the skill had no
tags:field at all. Undernamespace_skill_search(#713), an untagged skill falls into the genericGeneralnamespace alongside every other untagged skill -- exactly the crowded/unhelpful bucket the authoring guide (also from #713/#714) tells skill authors to avoid landing in.How it works
_register_imagegen_skill()now checks_is_codex_oauth_authenticated()before returning the skill registration, mirroring_advertise_imagegen_toolexactly. Logged out -> skill doesn't register at all.refresh_skill_cache()is called from both the login and logout paths so this takes effect immediately instead of requiring a process restart:/codex-auth//chatgpt-authsucceeds (alongside the existingset_model_and_reload_agentcall)./codex-logout//chatgpt-logout, alongside the existing_reload_active_agent()call that already does the equivalent job for tool unbinding.IMAGEGEN_SKILL.md:image-generation(first tag -> namespace),codex,gpt-image,artwork.Testing
test_imagegen_skill_and_tool_registrationto authenticate before asserting the skill registers (previously asserted unconditionally).test_imagegen_skill_is_not_registered_when_logged_out(mirrors the existing tool-side test of the same name pattern).test_logout_reloads_agent_to_unbind_imagegenassertion thatrefresh_skill_cache()is now also called, plus a newtest_logout_does_not_refresh_skills_when_already_logged_outto confirm no-op behavior when there was nothing to unbind.test_auth_command_refreshes_skill_cachefor the login path.code_puppy/plugins/chatgpt_oauth/test_plugin.py.test_plugin_meta.py,test_builtin_plugin_lock.py,test_agent_skills*.py, andtest_namespace_skill_search_plugin.py-- no interaction effects with the namespace/skills work in PUP-582: Add namespace_skill_search plugin: model-agnostic namespace + on-demand skill search #713/PUP-581: Split code-puppy-agent skill into topic reference docs, add namespace_skill_search coverage #714.ruff check/ruff format --checkclean.Related
Builds on the tag-order guidance from #713's
docs/AGENT_SKILLS.mdupdate and #714'scode-puppy-agentskill work -- this is Code Puppy's own built-in skill following the advice both of those PRs give to everyone else.