Skip to content

✨ sidecar: /v1/knowledge/advise callback so sidecar hives get the mid-task adviser (advisor phase 2, slice 5) #17157

Closed

Description

@clubanderson

Part of #17054 (approved direction: #17054 (comment)). RFC: docs/rfc-17054-llm-ranked-knowledge-advisor.md § "Where it runs" (Sidecar). Land on v5.

Readiness (owner condition 6): last slice. Open for work only after in-process rank mode has run with holdout_percent: 50 on hive's own hive for at least one week and the outcome comparison (#17156) is published on #17054.

Why

The phase-1 seam is in-process only: sidecarHost.SetKnowledgeAdviser in src/cmd/hive/agent_runtime_sidecar.go is a no-op, so sidecar-mode runtimes have no adviser at all. The hive side holds the knowledge store, the Primer and the inference credentials, so the work stays on the hive; the sidecar only ships the scope (and scrubbed pane tail) across and receives advice lines.

Scope

Acceptance criteria

  • Sidecar runtime with the route reachable delivers the same lines an in-process runtime delivers for the same pane fixture (golden test).
  • Route unreachable: nothing typed; exactly one warning per kick.
  • Request body never contains an unredacted token from the logscrub set; the hive rejects (400) a body whose PaneTail exceeds pane_lines.
  • The route refuses unauthenticated calls with the same status the other sidecar callbacks use.

Tests expected

Hive-side handler tests next to the other /v1/* callback tests; runtime-side client tests with httptest. CI is the verdict; do not run the suite from an agent pane.

Housekeeping

  • Changelog fragment: changelog.d/added-sidecar-knowledge-advise.md, single - bullet.
  • Docs: sidecar section of src/docs/design/crux.md and the advisor section of src/docs/agent-knowledge-and-memory.md; src/docs/api-reference entry for the route (let check-docs-citations.py --fix handle citations if CI reports drift).

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 8, 2026
  2. hivecommons-hive commented on Nov 8, 2026

    @hivecommons-hive
    Contributor

    Deferred: owner condition 6 gates this slice on a week of in-process rank mode with holdout_percent: 50 plus the #17156 comparison published on #17054. Not starting until that evidence exists.


    🐝 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

  3. added
    blockedWaiting on something outside this repository; not contributor work until a human clears the label
    on Nov 8, 2026
  4. removed
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    stage/010-actionableTriaged; eligible for the hive to pick up
    on Nov 8, 2026
  5. clubanderson commented on Nov 9, 2026

    @clubanderson
    MemberAuthor

    Advisor rank mode with 50% holdout enabled on hive's hive (r05x) at 2026-11-09T22:48Z; evidence window starts now → recheck 2026-11-17 earliest.

    Config (knowledge: section of /data/hive.yaml.runtime + .dashboard):

    advisor: true
    advisor_llm:
      mode: rank
      model: gpt-4.1
      endpoint: https://api.githubcopilot.com/chat/completions?_=
      api_key_file: /data/copilot-user-token
      holdout_percent: 50

    First decisions landed at 22:57Z (knowledge advisor: decision log lines; /data/knowledge-advisor-decisions.jsonl has its first arm: deliver / outcome: delivered record, plus held-out picks logged).

    Notes for follow-up (separate issues worth filing):

    • The advisor appends a hardcoded /v1/chat/completions to endpoint; the Copilot API only serves /chat/completions, hence the ?_= suffix workaround. It should honor endpoints already ending in /chat/completions.
    • No dashboard API exposes knowledge.advisor*, and hot-reload of /etc/hive/hive.yaml was starved (cfgReloadMu held by the governor run loop for whole eval cycles; startup tick ~800s), so the edit had to be done with the deployment scaled to 0 via a helper pod on the hive-data PVC. Backups: /data/hive.yaml.*.bak-advisor-20261109T224800Z.
  6. removed
    blockedWaiting on something outside this repository; not contributor work until a human clears the label
    on Nov 18, 2026
  7. hivecommons-hive commented on Nov 18, 2026

    @hivecommons-hive
    Contributor

    🔓 Claim by @Karibhou released (lease revoked).

    Claim history
    • 2026-11-18 22:06 UTC — claimed by Karibhou (contributor on hive hosted-available-oke-11-placeholder-r05x)
    • 2026-11-18 22:09 UTC — released by Karibhou (contributor; lease revoked)
  8. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 18, 2026
  9. Karibhou commented on Nov 18, 2026

    @Karibhou
    Contributor

    Owner condition 6 is still in effect. The Nov 18 rollout update excludes the Nov 9–14 data because rate limits starved the deliver arm. It schedules a Nov 21 recheck; the clean seven-day comparison has not been published and the owner has not cleared the sidecar slice. #17156 being closed means the measurement tooling landed, not that the rollout gate passed. No code or PR changes made.

    -- hive: backend=omp model=openai-codex/gpt-6.2-sol

  10. 11 remaining items

  11. added
    stage/020-claimedClaimed by the scanner or a relay contributor
    and removed
    stage/010-actionableTriaged; eligible for the hive to pick up
    stage/020-claimedClaimed by the scanner or a relay contributor
    on Nov 18, 2026
  12. hivecommons-hive commented on Nov 18, 2026

    @hivecommons-hive
    Contributor

    Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

    PR #19172 covers this issue: #19172

    The PR body says this is partial/non-closing work (Refs/Part of or 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.

  13. added
    hive/partially-addressedA merged PR addressed only part of this issue; remainder still actionable
    stage/010-actionableTriaged; eligible for the hive to pick up
    and removed on Nov 19, 2026
  14. github-actions commented on Nov 19, 2026

    @github-actions
    Contributor

    PR #19172 has merged (#19172) and referenced this issue with a non-closing Refs #17157 rather than a closing keyword.

    This issue remains open because the merged PR did not use Closes / Fixes / Resolves. If the fix should close it on merge, use a closing keyword in the PR body; use the opt-in hive: needs-confirmation marker only when the reporter genuinely must verify before closure.

  15. clubanderson commented on Nov 19, 2026

    @clubanderson
    MemberAuthor

    Closing as completed. Slice 5 landed in #19172 (merged 2026-11-19): POST /v1/knowledge/advise on the runtime-callback server with the same bearer auth as the other sidecar callbacks, fail-closed handling, pane-tail limits and re-scrubbing, golden and handler tests, changelog fragment and docs. It ships default off behind knowledge.sidecar_advise, per the 2026-11-18 owner decision on this issue. Turning it on for a live hive is a rollout decision gated on the rank-mode evidence tracked in #17054, not remaining work here. The merged PR used Refs rather than a closing keyword, which is why this stayed open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

approved-directionarea/coreIssues or PRs related to core changesenhancementNew feature or requesthelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/partially-addressedA merged PR addressed only part of this issue; remainder still actionable

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions