Repository navigation
Description
Symptom
On the dashboard Knowledge panel, "Add Git Source" β Clone & Index with an empty Display name (or URL) appears to do nothing. No error shows next to the form, no field is highlighted, the inputs keep their values.
Cause
kbAddGitSource (src/pkg/dashboard/static-src/js/knowledge.js ~L2051) does validate:
if (!url) { await hiveAlert('Repository URL is required'); return; }
if (!name) { await hiveAlert('Display name is required'); return; }but hiveAlert (tooltips-dialogs.js ~L533) routes any message β€220 chars with no newline to showToast(text, 'info') β a transient info toast in the toast container, far from the form, auto-dismissed. A validation failure on a button the user is looking at reads as "nothing happened".
The same pattern applies to kbAddSub ("URL is required").
Fix (part 1 β required-field feedback)
- Mark the missing field inline: add a
.field-invalidclass (red border) andaria-invalid="true"on the offending<input>, focus it, and render the message in a<div class="field-error" role="alert">directly under the input. Clear the state oninput. - If a toast is kept, use
showToast(msg, 'error')(sticky) rather thaninfoso it does not vanish. - Mark required inputs visually (
requiredattribute + label/placeholder marker) so users know before clicking. - Apply the same helper to
kbAddSuband the hub-side "Import" form on the right of the Knowledge panel.
Fix (part 2 β edit an existing git source)
There is no way to correct a fat-fingered URL/name/subpath/branch/layer: the server exposes only GET/POST (connect) / DELETE (disconnect) on /api/knowledge/git-sources (api_knowledge.go handleGitSourcesList/Connect/Disconnect; knowledge/api.go ConnectGitSource/DisconnectGitSource). Today the only recourse is Remove + re-add, which re-clones and re-indexes.
- Add an Edit button next to Remove on each git-source row that loads the row's values into the Add Git Source form (button label becomes Save; a Cancel link resets).
- Server:
PUT /api/knowledge/git-sources(orPATCH) taking{url, subpath}as the identity plus the new fields. Semantics:- name / layer change β update metadata in place, no re-clone.
- url / branch / subpath change β disconnect the old source and connect the new one atomically from the caller's point of view (one request, one audit row).
- Same validation + inline errors as part 1.
- Owner-gated like connect/disconnect; audit row
knowledge_git_source_update. - Tests: handler table test for metadata-only vs re-clone paths; JS validation helper test if there is a harness for
knowledge.js.
Acceptance
- Clicking Clone & Index with an empty required field highlights the field, focuses it, and shows the message under it.
- Each existing git source row has Edit; saving a corrected display name does not re-clone; saving a corrected URL re-indexes and the row reflects the new values.
Activity
hivecommons-hive commentedon Nov 10, 2026
Decomposed into two sub-issues so each lands as one focused PR (the two parts are independent concerns and together touch well over five files):
PUT /api/knowledge/git-sources(server + UI); blocked by [scanner] π [v5] Knowledge: inline required-field errors for Add Git Source / Add Sub / Import formsΒ #17587 because both touchknowledge.jsThis issue stays open as the tracker and closes when both children land.
π Hive Agent:
scanner| Instance:hosted-available-oke-11-placeholder-r05x| SHA:unknownβ hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88
hivecommons-hive commentedon Nov 10, 2026
PR #17589 covers this issue: #17589
The PR body says this is partial/non-closing work (
Refs/Part ofor leave-open wording), so Hive will not add a closing keyword. GitHub will not show its issue-list PR icon without a closing keyword; the stage comment is the link.hivecommons-hive commentedon Nov 10, 2026
PR #17596 covers this issue: #17596
GitHub only shows its linked-PR icon for closing-keyword PRs that target the repository default branch; this PR targets
v6, so Hive cannot make GitHub display that icon for this issue.clubanderson commentedon Nov 10, 2026
Additional finding from a real repro: Branch left blank, Clone & Index clicked, nothing visible happened.
Two more defects in the same handler (
knowledge.jskbAddGitSource, ~L2051β2078):The busy state never shows. The button is wired with
data-action="kbAddGitSource"(L1902) but the handler looks it up withdocument.querySelector('#kb-subs-content button[onclick="kbAddGitSource()"]')β a selector left over from the inline-onclick days. It matches nothing, sobtnis null and the "Cloning..." label /disablednever apply. The user clicks and sees a dead button while the server runs agit clone --depth 1(up togitSourceCloneTimeout). Fix:document.querySelector('#kb-subs-content [data-action="kbAddGitSource"]'), orevent.currentTargetpassed through the dispatcher.Blank branch is silently sent as
main. The client substitutesbranch || 'main'; the server clones with--branch main. If the repo's default branch is anything else,ensureClonedfails (exit status 128 β¦ Remote branch main not found), the handler returns 500, and the client passes the error tohiveAlert, which (per the issue body) becomes a transient info toast or, when the message is long, a modal β but only after the clone attempt has run to failure. Combined with (1) the user has no idea a request is in flight or that it failed.Fix: when branch is blank, do not guess β have the server resolve the remote default branch (
git ls-remote --symref <url> HEAD) and clone that, recording the resolved branch in the saved config so the row shows what was actually indexed. Keep the placeholder honest: "Branch (blank = repo default)".Surface the result on the row, not only in a toast: after a failed connect, render the attempted source as a row with status
error: <reason>and an Edit/Retry button (ties into part 2), so a failure is visible when the user returns to the panel.Acceptance addendum: clicking Clone & Index immediately disables the button and shows "Cloningβ¦"; a repo whose default branch is not
mainindexes successfully with the branch field blank; a failed clone leaves a visible error row.clubanderson commentedon Nov 10, 2026
Part 3 (busy state never shows, blank branch guessed as main, failed clone invisible) split out as #17610 so this tracker closes when #17587, #17588 and #17610 all land.
β¨ knowledge: edit an existing git source (PUT /api/knowledge/git-sourβ¦
hivecommons-hive commentedon Nov 11, 2026
Fixed by #17596 (merged 087a692). Closing. Reply /reopen if the problem persists.
github-actions commentedon Nov 11, 2026
@clubanderson this issue was closed by @hivecommons-hive[bot] as completed.
If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it β check your running version against the fix before concluding the fix failed.
If you are still seeing the problem, comment
/reopenand it will be reopened for you β you do not need write access. Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.