Skip to content

refactor: define THINKING_LEVELS in one place - #432

Open
amandeavor wants to merge 1 commit into
Observal:mainfrom
amandeavor:refactor/dedupe-thinking-levels
Open

amandeavor wants to merge 1 commit into
Observal:mainfrom
amandeavor:refactor/dedupe-thinking-levels

Conversation

@amandeavor

@amandeavor amandeavor commented Sep 25, 2026 •

Copy link
Copy Markdown

Summary

THINKING_LEVELS was duplicated in packages/protocol/src/provider-management.ts and as a hand-written Set in packages/ai/src/catalog-validation.ts. Both now consume the canonical export from model-stream.ts / @axl/protocol.

Closes #422

Test plan

  • pnpm --filter @axl/protocol test (39 pass)
  • pnpm --filter @axl/ai test (284 pass)

Summary by CodeRabbit

  • Bug Fixes
    • Thinking-level validation now consistently follows the levels supported by the protocol.

Import the canonical list from model-stream into protocol
provider-management, and build the catalog-validation Set from the
@axl/protocol export so level renames cannot drift.

Closes Observal#422
Copilot AI lite review requested due to automatic review settings September 25, 2026 07:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: fd25e666-ec95-4161-936f-3c900ba4a0ed

📥 Commits

Reviewing files that changed from the base of the PR and between c9b6481 and 7ea5633.

📒 Files selected for processing (2)
  • packages/ai/src/catalog-validation.ts
  • packages/protocol/src/provider-management.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

Provider-management and catalog validation now use the protocol package’s shared THINKING_LEVELS constant instead of maintaining separate lists.

Changes

Thinking-Level List

Layer / File(s) Summary
Use shared thinking-level list
packages/protocol/src/provider-management.ts, packages/ai/src/catalog-validation.ts
Provider-management imports the shared constant instead of defining a local list. Catalog validation builds its validation set from the protocol constant. Existing validation use remains in place.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Refactor

Suggested reviewers: kaushik-kumar-ceg

Merge Risk: ⚪ Minimal · up to 7ea56

The refactor preserves the supported thinking levels and uses the protocol package’s public export. No actionable merge-blocking risk was identified.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the refactor, references issue #422, and lists protocol and AI test results. It does not follow the repository template and omits the required Purpose, Fixes, Approach, How wa… Update the description to use the repository template. Include the purpose, fixes reference, implementation approach, compatibility or security impact, complete test commands and results, all checklist items, and the AI assistance section.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: centralizing the THINKING_LEVELS definition.
Linked Issues check ✅ Passed Issue #422 requires one THINKING_LEVELS definition, reuse in provider-management.ts and catalog-validation.ts, preserved package boundaries, and passing protocol and AI tests. The PR imports `TH…
Out of Scope Changes check ✅ Passed The reported changes are limited to replacing duplicate THINKING_LEVELS definitions with the canonical export in the two locations named by issue #422. The changes support the requested pure refacto…
Full details: Description check

Explanation

The description explains the refactor, references issue #422, and lists protocol and AI test results. It does not follow the repository template and omits the required Purpose, Fixes, Approach, How was this tested?, Checklist, and AI assistance sections.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

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.

Remove duplicate THINKING_LEVELS lists

2 participants