fix(component): omitted --project resolves to first configured project - #666
Merged
Conversation
component detail --component-id ID and config new (scaffold-only) document --project as optional, but passing the omitted alias through as [None] hit BaseService.resolve_projects' strict path and failed with CONFIG_ERROR "Project 'None' not found". Resolve an omitted alias to the first configured project (the pattern get_config_examples already used), via a shared ComponentService._resolve_alias_or_first helper returning a ResolvedProject dataclass; with no projects configured the failure is an actionable "No projects configured" ConfigError, and project_alias in the detail payload reports the alias actually used. component sync-action is unaffected (--project is genuinely required on the CLI); server routers already resolve a pinned alias and are unchanged. Gotchas + commands-reference tagged (since vNEXT) per the release process.
padak
added a commit
that referenced
this pull request
Aug 23, 2026
* chore(release): 0.90.0 Bumps pyproject.toml to 0.90.0 and adds the changelog entry covering every PR merged since v0.89.0 (#658, #662, #661, #663, #665, #666, #664, #668, #667, #623), resolves the vNEXT placeholders those PRs left behind, and adds the curated What's new reel for the release. * docs(web-server): keep the What's-new anchor stable across releases The '### What's-new popup *(since vNEXT)*' heading put the version gate in the heading itself, so resolving the placeholder to 0.90.0 changed the generated slug to 'whats-new-popup-since-0900' and broke the in-page link at line 138 -- and would have broken it again on every future release. Moved the '(since 0.90.0)' tag to the first body line: the anchor is now the stable 'whats-new-popup', the gate stays visible, and check_version_gates.py still sees it (it scans the whole file, not just headings).
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
kbagent component detail --component-id IDwithout--projectfails witheven though the option's help text says "Project alias (uses first available if not set)". The same reachable bug affects
kbagent config newin scaffold-only mode (no--push), whose--projectis also documented as optional.Root cause
commands/component.py::component_detailpassesalias=NonetoComponentService.get_component_detail, which callsself.resolve_projects([alias]).BaseService.resolve_projectsonly falls back to "all projects" when the alias list is empty/None—[None]is a truthy list, so it takes the strict lookup path and raisesproject_not_found_error(None).get_config_examplesin the same service already implemented the correct normalisation.Fix
ComponentService._resolve_alias_or_first(alias)helper (returns a frozenResolvedProjectdataclass per CONTRIBUTING's multi-value-return rule): resolves a given alias strictly, falls back to the first configured project when omitted, and raises an actionableConfigError("No projects configured...") when the config is empty.get_component_detailandgenerate_scaffoldnow use it (signatures widened toalias: str | None); the detail payload'sproject_aliasreports the alias actually used, on both the AI Service and Storage-catalog fallback paths.get_config_examplesrefactored onto the same helper (behavior unchanged).run_sync_action—component sync-action's--projectis a required Typer option (exit 2 without it) and the serve router resolves a pinned alias before calling, soNonecan never reach it. Server routers untouched.Tests
TDD: all four new tests first failed with the reported
Project 'None' not founderror, then passed after the fix.TestGetComponentDetail:alias=Noneresolves to the single configured project (andproject_aliasreports it); no projects configured →ConfigError.TestGenerateScaffold: same two cases for theconfig newscaffold path.Full suite: 6026 passed, 181 skipped. Lint/format/ty clean;
version-gate-check,skill-check,command-sync-check,check-sentinel-guardsall pass.Docs
gotchas.mdgains a(since vNEXT)section andcommands-reference.mdtwo one-line notes: on <= 0.89.x these two commands need an explicit--projectdespite the help text. No version bump, no changelog entry (feature-PR rules per #648).