agent-native icon indicating copy to clipboard operation
agent-native copied to clipboard

Composer "Upload skill file" does nothing after a file is chosen

Open nabilkhan199999 opened this issue 1 month ago • 0 comments

Summary

We use Agent Native. In the chat composer, + → Create Skill → Upload skill file opens the file chooser, but after a SKILL.md file is chosen nothing happens. No review form appears, no request is made and no skill is saved. Reopening the menu shows the normal menu, and the chosen file is gone.

The menu closes as soon as the file chooser takes focus from the page. The review-and-save step for an uploaded skill is rendered inside that menu, so once the menu has closed, the upload can't continue.

Uploading the same file through Settings → Skills → Add skill → Upload works.

Environment

  • Versions: @agent-native/core, @agent-native/toolkit and @agent-native/agentkit 0.209.2. Also seen on 0.207.0.
  • Latest stable when checked: 0.212.1. ComposerPlusMenu.tsx is unchanged from 0.209.2.
  • App: reproduced in a freshly scaffolded app (create --standalone --template chat), run with agent-native dev, as well as in our internal app.
  • We use the shared AgentKit chat and its default composer.

Steps and observed behavior

  1. Open the chat and click + (Add context) in the composer.
  2. Open Create Skill and choose Upload skill file. The file chooser opens.
  3. Choose a valid SKILL.md file with name and description front matter.
  4. Nothing happens. The menu is closed, no review form appears, no request is sent to /_agent-native/resources, and no skill is created.
  5. Open + → Create Skill again. The submenu shows Create new skill and Upload skill file again. There's no trace of the chosen file.

To narrow it down, we took focus away from the page while both menus were open, as the file chooser does. Both the menu and the Create Skill submenu closed straight away.

As a control, we stopped the native file chooser from opening, so the page kept focus, and gave the file input the same SKILL.md. In that case the menu stayed open, the review form appeared ("Review the content from SKILL.md before saving", with the skill name and the skills/<name>/SKILL.md path), and Save created the skill. The upload flow works once a file reaches it. It fails because the menu closes while the chooser is open.

Expected behavior

After a skill file is chosen with Upload skill file, the review form appears and the skill can be saved, as it is from Settings → Skills.

Impact

Users can't upload a skill from the chat composer. The chooser opens and then nothing happens, with no error, so it looks like the file was ignored.

Relevant code observations

These are static source observations from 0.209.2:

  • In src/composer/ComposerPlusMenu.tsx, the Upload skill file item calls skillFileInputRef.current?.click() from its onSelect. When a file is chosen, handleSkillFileSelected reads it and switches the Create Skill entry to its skill-upload view, which is rendered inside the menu. The entry's onDismiss is cancelSkillWork.
  • In src/composer/ComposerContextMenu.tsx, closing the menu (changeOpen(false)) or the submenu calls dismissPage, which runs the entry's onDismiss. The submenu's onFocusOutside keeps it open only when focus moves to another composer menu element, not when the page loses focus.
  • For comparison, AddSkillMenu in src/app/settings/shell/pages/resource-settings-page.tsx keeps its file input outside the dropdown and uploads directly from the input's change handler, so its menu closing doesn't affect the upload.

These observations fit the menu dismissing, and discarding the in-progress upload, when the native file chooser takes focus.

nabilkhan199999 avatar Oct 22 '26 11:10 nabilkhan199999