Filter hackbot UI runs by selected agent and drop localStorage#6365
Draft
suhaibmujahid wants to merge 1 commit into
Draft
Filter hackbot UI runs by selected agent and drop localStorage#6365suhaibmujahid wants to merge 1 commit into
suhaibmujahid wants to merge 1 commit into
Conversation
The recent-runs panel now sources its list entirely from the hackbot-api GET /runs endpoint, filtered server-side to the agent selected in the trigger form (carried in the ?agent= URL param). This removes the localStorage run store, which was only needed because the panel could not list runs from the backend. - hackbot-api: add optional agent filter to GET /runs - ui: listRuns(limit, agent); /api/runs passes agent through - ui: shared lib/agents.ts (agent list + parseAgent) used by the form and panel - ui: selecting an agent updates ?agent= so the panel refetches for it - ui: delete lib/store.ts and all localStorage usage
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.
What
The hackbot UI recent-runs panel now shows only runs from the agent selected in the trigger form, and no longer relies on the browser's
localStoragefor the list of runs.Why
Previously the panel merged the hackbot-api
GET /runsresponse with alocalStoragestore (lib/store.ts), and it showed runs from all agents regardless of which agent was selected. Selecting an agent had no effect on the panel.Changes
GET /runsaccepts an optionalagentquery param and filters server-side (theagentcolumn is already indexed).lib/hackbot.ts:listRuns(limit, agent?)forwards the filter./api/runs: passes theagentquery param through.lib/agents.ts(new): shared agent list +parseAgent, used by both the trigger form and the panel so they agree on the selected agent.TriggerForm: selecting an agent writes?agent=to the URL.RecentRuns: reads the selected agent from?agent=, fetches only that agent's runs from the API, and refetches on change / while polling. Wrapped inSuspense(usesuseSearchParams).lib/store.tsand alllocalStorageusage (also dropped the now-unusedupdateRunStatus/saveRuncalls inRunDetail/TriggerForm).Notes
?agent=param, both the form and the panel default tobug-fix, so they stay consistent.next build/tscin this environment (nonode_modules, registry not reachable); the pre-commit prettier hook over the TS/TSX files passed.