Skip to content

fix: address bot-review findings on the generator-profile PRs - #180

Merged
jaylfc merged 2 commits into
masterfrom
fix/bot-review-findings
Jun 30, 2026
Merged

fix: address bot-review findings on the generator-profile PRs#180
jaylfc merged 2 commits into
masterfrom
fix/bot-review-findings

Conversation

@jaylfc

@jaylfc jaylfc commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Sweeps the real CodeRabbit + kilo-code-bot findings on #177/#178 (auto-merged before the bots posted) into one pass. Whole-branch reviewed READY TO MERGE.

  • CLI --data-dir now threaded to the generator-profile subcommands (was writing the default store).
  • CLI unknown --agent returns a clean error + nonzero instead of a traceback.
  • resolve_memory_model gains an agent param (fallback stays first positional; callers converted to keyword), forwarded so per-agent profiles are honored on the extraction path; resolve_generator guards the lookup so an unregistered/"default" agent falls back to global (no crash).
  • POST /generator-profile except narrowed to (AgentNotFoundError, ValueError); other errors propagate to 500.
  • Dashboard selector surfaces a getStats() failure via ErrorBanner instead of silent-empty.
  • Tests added (per-agent CLI, unknown-agent nonzero, per-agent resolve, field-removed-on-clear). Skipped low-level setter validation deliberately (mirrors set_memory_model; boundaries validate). Full suite 1023.

@jaylfc
jaylfc merged commit 241176f into master Jun 30, 2026
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jaylfc, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1add20ed-a9e5-4b1f-9654-3e86caec9c49

📥 Commits

Reviewing files that changed from the base of the PR and between fab3ab4 and 38a8656.

📒 Files selected for processing (14)
  • dashboard/src/components/GeneratorProfileSelector.tsx
  • taosmd/catalog_pipeline.py
  • taosmd/cli.py
  • taosmd/config.py
  • taosmd/emem_event_lift.py
  • taosmd/generator_profiles.py
  • taosmd/http_server.py
  • taosmd/memory_extractor.py
  • taosmd/webui/assets/index-BYD--bJq.js
  • taosmd/webui/index.html
  • tests/test_config_memory_model.py
  • tests/test_generator_profile_agent.py
  • tests/test_generator_profile_cli.py
  • tests/test_generator_resolution.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bot-review-findings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gitar-bot

gitar-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

Comment thread taosmd/http_server.py
else:
_cfg.set_generator_profile(pid, data_dir=data_dir)
except Exception as exc: # e.g. AgentNotFoundError
except (_agents.AgentNotFoundError, ValueError) as exc:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: ValueError is a very broad catch — this can swallow programmer errors (e.g., a KeyError re-raised as ValueError, bad config types). The PR description says this was narrowed from a bare except Exception, which is good, but consider catching the specific validation error the underlying call raises rather than all of ValueError. If set_agent_generator_profile is the only relevant caller and it only raises AgentNotFoundError, the ValueError arm may be dead code.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread taosmd/cli.py
agents.set_agent_generator_profile(agent, profile_id, data_dir=data_dir)
try:
agents.set_agent_generator_profile(agent, profile_id, data_dir=data_dir)
except agents.AgentNotFoundError:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Inconsistent with http_server.py:1048 which catches both AgentNotFoundError and ValueError. Today set_agent_generator_profile only raises AgentNotFoundError, but if a future validation (e.g., profile_id name rules) raises ValueError, the CLI will surface an uncaught traceback — which is exactly what the PR set out to fix for the unknown-agent case. Consider catching (agents.AgentNotFoundError, ValueError) here too for symmetry.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

.catch((err: unknown) => {
// Surface via the existing ErrorBanner so the user sees a signal rather
// than silently falling back to the global "all" scope only.
setError(err instanceof Error ? err.message : String(err));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: The ErrorBanner rendered at line 88 wires onRetry={() => void loadProfile(scope)}, but the error you just set comes from getStats() in this useEffect, not from loadProfile. Clicking Retry will (a) re-fetch the profile (which may not be the failing call) and (b) immediately clear the error via setError(null) inside loadProfile, but agentNames will remain empty and getStats() will not be retried. The user sees a misleading "retry" affordance that doesn't address the underlying failure.

Suggested fix: track which fetch errored and route retry accordingly (e.g., retryFn local state, or split the error banner so getStats failures have a separate retry handler that re-runs the useEffect).


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

resolved_model = extraction_model
if not resolved_model or resolved_model == "default":
resolved_model = resolve_memory_model() or "default"
resolved_model = resolve_memory_model(agent=agent_name or "default") or "default"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: agent_name or "default" will almost never match a registered agent, so resolve_generator silently falls back to the global profile anyway. The agent= kwarg only adds value when agent_name is truthy. Consider resolve_memory_model(agent=agent_name) if agent_name else resolve_memory_model() so the per-agent lookup only runs when the caller actually has a registered agent, and document the fallback semantics.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 2
Issue Details (click to expand)

WARNING

File Line Issue
taosmd/cli.py 178 CLI catches only AgentNotFoundError, asymmetric with http_server.py:1048 which catches ValueError too. A future ValueError from validation will traceback.
dashboard/src/components/GeneratorProfileSelector.tsx 23 getStats() failure surfaces in ErrorBanner, but onRetry (line 88) calls loadProfile, not getStats — clicking retry does not address the underlying failure.

SUGGESTION

File Line Issue
taosmd/http_server.py 1048 ValueError is broad; could swallow programmer errors. Consider narrowing or removing the ValueError arm if no caller raises it.
taosmd/memory_extractor.py 263 agent=agent_name or "default" won't match any registered agent; the per-agent lookup silently falls back to global. Only pass agent= when agent_name is truthy.
Files Reviewed (13 files)
  • taosmd/catalog_pipeline.py - 0 issues
  • taosmd/cli.py - 1 issue
  • taosmd/config.py - 0 issues
  • taosmd/emem_event_lift.py - 0 issues
  • taosmd/generator_profiles.py - 0 issues
  • taosmd/http_server.py - 1 issue
  • taosmd/memory_extractor.py - 1 issue
  • dashboard/src/components/GeneratorProfileSelector.tsx - 1 issue
  • taosmd/webui/index.html - 0 issues (asset hash bump only)
  • taosmd/webui/assets/index-BYD--bJq.js - 0 issues (built bundle, 77% similarity rename)
  • tests/test_config_memory_model.py - 0 issues
  • tests/test_generator_profile_agent.py - 0 issues
  • tests/test_generator_profile_cli.py - 0 issues
  • tests/test_generator_resolution.py - 0 issues

Fix these issues in Kilo Cloud


Reviewed by minimax-m3 · Input: 42.3K · Output: 5.7K · Cached: 494.7K

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant