attach_image.attach_image(path) raises TypeError: module not callable (costs a failed tool step per image) #2222
vladzima
started this conversation in
Bug reports
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Bug
Bundled Python skills laid out as
<skill>/<skill>.py(attach_image,websearch) expose the submodule under the skill name. Soattach_image.attach_imageis a module, and:Models try that spelling first in practice. In my logs, 8 of 8 sessions since 2026-09-01 that attached an image hit this TypeError, then retried with
await attach_image(path). That is one wasted failed tool step per image, every time.Version: prime-agent 0.9.4. Repro: any session, ask the agent to look at a PNG, watch the first
attach_image.attach_image(...)cell fail.Proposed fix
In
_prime_agent_wrap_skill_module(src/core/tools/ipython.ts), set<module>.<short_name> = runon the wrapped module when that attribute is not already callable.await attach_image(...)and.run(...)are unchanged;await attach_image.attach_image(...)works too.Ready branch with a kernel test that fails without the alias and passes with it (5 lines of code + 19 lines of test):
https://github.com/vladzima/prime-agent/tree/fix/skill-module-self-name-alias
(diff: main...vladzima:prime-agent:fix/skill-module-self-name-alias)
PR #2221 was auto-closed by the vouch bot; happy to reopen if a maintainer invites it.
Validation:
npx vitest --run test/kernel-attach-image-skill.test.ts10 passed; new test fails with the TypeError whenipython.tsis stashed; biome clean on touched files.All reactions