feat(knowledge): config-driven per-workload pool effort + settings UI - #8345
Open
atomsbaza wants to merge 3 commits into
Open
feat(knowledge): config-driven per-workload pool effort + settings UI#8345atomsbaza wants to merge 3 commits into
atomsbaza wants to merge 3 commits into
Conversation
Add knowledge.extraction_effort / knowledge.fetch_effort (enum ['', low..max], default '' = inherit). Resolution per pool: explicit key -> agent.role_efforts.background -> fallback (extraction high, fetch provider default), so an explicit low now wins where the old constant overrode it. Gate effort application in AcpWorker on model_supports_effort for the kiro backend: unsupported models (e.g. auto) skip the push with one INFO line instead of a rejected /effort per worker spawn. Replace the use_config_pool_size flag with an explicit config_pool_size_key, so knowledge.extraction_pool_size no longer silently resizes the auto_research pool. Drop the knowledge_llm_pool alias and the sync_source fallback (no production consumers). Move select_effort_level to kiro_crew.effort so the ladder lives in one place. Update docs/system-specs/modules/knowledge.md for the two-pool policy.
Move the extraction-model and extraction-pool-size controls out of the Knowledge tab's settings into a Knowledge section on Settings > Chat, and add Extraction Effort / URL Fetch Effort selectors alongside them. The panel's own SettingsSelect primitives feed the generated settings registry, so the new controls deep-link from the command palette. Capture harness + screenshots (docs/assets/pr-knowledge-effort/) cover the default state, picked values, and the slimmed-down Knowledge tab.
The template requires capture media under the ephemeral temp-screenshots/<feature>/ dir (never docs/) with SHA-pinned embed URLs.
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.
Problem / Motivation
Upstream PR #3944 isolated the Knowledge extraction and URL-fetch pools but hardcoded the policy: extraction always ran at
DEFAULT_EXTRACTION_EFFORT = "high", overridingagent.role_efforts.background, and the review pipeline flagged the framing and mechanics (first-principles BLOCK, design CONCERNS):highignores every operator effort knob (a test pinned that an explicitbackground: lowwas ignored).automodel, kiro-cli rejects effort — the pool pushed/effortanyway, logging a warning on every worker spawn._select_effort_levelinllm_pool.pyduplicated the effort ladder inproviders/acp.py.use_config_pool_sizepatched the symptom of a workload-specific key inside the genericLLMPool;auto_research_llm_poolwas still silently resizable byknowledge.extraction_pool_size.knowledge_llm_poolalias +sync_sourcefallback had zero production consumers.docs/system-specs/modules/knowledge.mdstill documented the pre-feat(knowledge): isolate workload effort pools #3944 shared pool.Why it matters
Operators pay real money for reasoning effort. Before this PR the operator had
no way to turn extraction effort down from the hardcoded
high— everydocument ingestion billed at high effort even when the material is routine,
and the setting was invisible in the UI. Meanwhile every worker spawn on a
non-reasoning model (the default
auto) logged a failed effort push. After:effort is a first-class settings control per workload, the default behavior is
byte-identical for operators who never touch it, and unsupported models stop
generating warning spam.
What changed (motivation → approach → change)
Config-driven effort (fixes 1)
knowledge.extraction_effortandknowledge.fetch_effort(enum["", low, medium, high, xhigh, max], default"").agent.role_efforts.background→ fallback (highfor extraction, provider default for fetch). Settinglownow actually yieldslow; operators who never touch the keys keep today's behavior.Model-support gating (fixes 2)
AcpWorker._apply_effortchecksmodel_supports_effortbefore pushing on the kiro backend; unsupported models (e.g.auto) skip with a single INFO line instead of a rejected/effortper spawn. The claude config-option path keeps its existing gating.Ladder dedupe (fixes 3)
select_effort_level(requested, supported)now lives inkiro_crew.effort;llm_poolimports it.providers/acp.pykeeps its trial-descend loop (that transport has no advertised list to read) — two transports, one ordering.Pool-size decoupling + alias removal (fixes 4, 5)
use_config_pool_sizereplaced by an explicitconfig_pool_size_key; only the extraction pool passes it.auto_research_llm_poolis no longer silently resized by a Knowledge-section key.knowledge_llm_poolalias and thesync_sourcefallback deleted; missingknowledge_fetch_poolnow fails loudly.Settings UI
SettingsSelect/SettingsInputprimitives +configKey, so the generated settings registry picks them up and command-palette<SettingRef>chips deep-link.npm run i18n:checkpasses,en-XAregenerated.Docs (fixes 6)
docs/system-specs/modules/knowledge.mdupdated for the two-pool policy, the new keys, the resolution chain, and the model-support gate.Tests
test_llm_pool.py,test_knowledge_effort_pools.py,test_knowledge_sync_local_file.py,test_knowledge_handlers_coverage.py,test_config_loader.py— including the deliberate flip of the old pin:extraction_effort="low"now wins over thehighfallback.KnowledgeSettingsTab+SettingsChatPanelCoveragegreen (749 tests in the touched areas); fullnpm testsuite green after the fixes below.flake8, targetedmypy,isort, black formatting gate,npm run buildall pass.Manual verification
website/scripts/capture-knowledge-effort.mjs) drives the real built SPA with fixture-backed APIs:low, fetchmedium, pool size 5):Out of scope
CCWorker(claude_code harness) still takes no effort — pre-existing gap, harness-parity-neutral.extraction_pool_size).Related Issues
No tracked issue; addresses the review findings on #3944.