Repository navigation
Slash-command skills and Apollo-owned history for the global assistant - #5236
Conversation
Security Review ✅
|
elias-ba
left a comment
There was a problem hiding this comment.
Great work Hanna 👏🏽, I enjoyed reading this one, and letting Apollo own the history is the right call. I have left a few comments and questions below, could you please feel free to let me know what you think?
The one I would fix is Escape in the slash menu. Press it once and the menu never comes back. The other two are about /qa, which we describe as a review when the skill rewrites job code, and a comment that gets Apollo's rule for valid skill names slightly wrong.
Worth checking the deploy order with whoever ships this. Apollo on main doesn't know what skill is, so if Lightning goes first the menu works and nothing happens.
The changelog has no entry, and the note saying the landing screen has no slash menu is out of date now.
Thanks!
| const [input, setInput] = useState(''); | ||
| const [skill, setSkill] = useState<AISkill | null>(null); | ||
| const [highlighted, setHighlighted] = useState(0); | ||
| const [dismissedMenuFor, setDismissedMenuFor] = useState<string | null>(null); |
There was a problem hiding this comment.
Escape is sticky here. dismissedMenuFor is set to whatever is in the input and never cleared, not on send and not in reset, so one Escape stops a bare / opening the menu for as long as the panel is mounted, which is the whole editor session. Clearing the input by hand doesn't bring it back. The Escape test sends straight afterwards, so nothing catches it.
While you're in here, the handler calls preventDefault but not stopPropagation, so the same Escape carries on to the window and the editor's Escape handlers run with it. The other menus join the keyboard registry instead, SnapshotVersionDropdown.tsx:67 and AdaptorSelector.tsx:79. Could this one do the same?
There was a problem hiding this comment.
Confirmed, thanks. It's now cleared on any change and on reset, with a test that the menu opens again after Escape.
For the propagation I used stopPropagation rather than the keyboard registry: the registry would mean wrapping every ChatInput test render in a provider, and the effect is the same because the editor's shortcuts listen on window. There's a test for that too, and I checked it in the browser with a step open in the code editor: Escape closes only the menu. Happy to switch if you'd prefer the registry anyway.
| workflow: "existing" | ||
| }, | ||
| %{ | ||
| name: "qa", |
There was a problem hiding this comment.
This reads as a lint, but Apollo's qa reviews the workflow against what it is meant to do, and its body has the job code agent fix every step on the way through. So someone who picked "review for bugs and risky patterns" gets their job code rewritten. I've asked about the skill itself on OpenFn/apollo#711, so it may change on that side first, but whichever way it lands the menu line and the skill should say the same thing.
There was a problem hiding this comment.
Agreed. Apollo #711 now makes /qa report first and fix only when asked, and the menu line reads "Review this workflow and list what should change" to match.
| @moduledoc """ | ||
| Skills the user can invoke in the global assistant with a slash command. | ||
|
|
||
| These are Apollo's standard skills, so each name must match a |
There was a problem hiding this comment.
Small one, but this comment is the only thing keeping our list in step with Apollo's. Apollo splits its skills folder by whether the frontmatter has metadata.agent, and only the ones without it can be asked for by name. OpenFn/apollo#711 adds qa-code, which has a SKILL.md at exactly the path described here and would still come back as a 400. Could this say a skill folder with no metadata.agent?
There was a problem hiding this comment.
Good point, reworded to say a skill folder with no metadata.agent.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5236 +/- ##
=====================================
Coverage 91.5% 91.5%
=====================================
Files 465 466 +1
Lines 23787 23803 +16
=====================================
+ Hits 21756 21776 +20
+ Misses 2031 2027 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks @elias-ba! Apollo #711 goes out first: old Lightning never sends Changelog entry added, the landing-screen note is gone, and the branch is up to date with main. |
elias-ba
left a comment
There was a problem hiding this comment.
Nice job @hanna-paasivirta. Thanks for taking into account the changes
Description
This PR adds slash-command skills (
/design,/diagnose,/qa) to the global assistant and stores Apollo's conversation history so it can be sent back unchanged. It is the Lightning side of OpenFn/apollo#711.Closes BLD-71
Closes OFN-4757
Decisions
/designkeep working over several turns: its instructions stay in the history, and there is no skill mode that ends, which is also how Claude Code handles skills.skill, only on the turn that starts with/name. Apollo strips the command and keeps the skill in its history.Changes
apollo_historycolumn onai_chat_sessions. After each successful response, thehistoryfrom the finalcompleteevent is saved as received, for job, workflow and global chat. The next request sends it back ashistory. Sessions from before this fall back to rebuilding history from messages./namesendskill: {name}to Apollo.ai_skillsin the session context). The chosen skill shows as a pill, on the input and on sent messages.Validation steps
slash-command-presetbranch (Add skills as slash commands apollo#711) and point Lightning at it./and checkdesign,diagnoseandqaare listed./designand answer its questions over a few turns. It should keep asking design questions rather than building straight away.apollo_historycolumn holds the full history, including the skill instructions and[pg:...]page prefixes.Additional notes for the reviewer
skill, so with Lightning first the menu works but no skill runs. Apollo alone changes nothing for current Lightning.AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy
Pre-submission checklist
/reviewwith Claude Code)
(e.g.,
:owner,:admin,:editor,:viewer)