Skip to content

♻️ Reorder enum entries in AnalysisModel#75

Merged
romantech merged 3 commits intomainfrom
ai
Mar 8, 2026
Merged

♻️ Reorder enum entries in AnalysisModel#75
romantech merged 3 commits intomainfrom
ai

Conversation

@romantech
Copy link
Copy Markdown
Owner

No description provided.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
syntax-analyzer Ready Ready Preview, Comment Mar 8, 2026 10:13am

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Rename analysis models to generic names and reorder enums

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Rename analysis model enums for clarity and abstraction
  - Replace GPT_4O_MINI_FT with FAST_FT (basic model)
  - Replace GPT_4O_FT with PRIMARY (advanced model)
  - Add new FAST enum entry
• Update UI labels to use generic model names
  - Change from specific model names to '기본 모델' and '고급 모델'
• Adjust decrement counts for new model structure
  - FAST_FT and FAST both decrement by 1
  - PRIMARY decrements by 2
• Update all references across form schema and components
Diagram
flowchart LR
  A["Old Model Names<br/>GPT-4o-mini/GPT-4o"] -->|Rename| B["Generic Names<br/>FAST_FT/PRIMARY"]
  B -->|Update| C["UI Labels<br/>기본/고급 모델"]
  B -->|Update| D["Decrement Config<br/>1/1/2 counts"]
  C -->|Apply| E["Form Components<br/>Schema & UI"]
  D -->|Apply| E
Loading

Grey Divider

File Changes

1. src/features/syntax-analyzer/constants/settings.ts ✨ Enhancement +6/-4

Rename analysis models and update decrement counts

• Renamed AnalysisModel enum entries from GPT model names to generic names (FAST_FT, FAST,
 PRIMARY)
• Updated ANALYSIS_DECREMENT_COUNT mapping with new enum keys and adjusted decrement values
• FAST_FT and FAST now decrement by 1, PRIMARY by 2

src/features/syntax-analyzer/constants/settings.ts


2. src/features/syntax-analyzer/schemes/analysis-form-schema.ts ✨ Enhancement +1/-1

Update default analysis model selection

• Updated default model value from GPT_4O_MINI_FT to FAST_FT
• Maintains validation against AnalysisModel enum values

src/features/syntax-analyzer/schemes/analysis-form-schema.ts


3. src/features/syntax-analyzer/components/analysis-form/analysis-counter.tsx ✨ Enhancement +1/-1

Update counter description with generic model names

• Updated user-facing description text to use generic model terminology
• Changed reference from GPT_4O_FT to PRIMARY for decrement count display
• Updated Korean text from 'GPT-4o 모델' to '고급 모델'

src/features/syntax-analyzer/components/analysis-form/analysis-counter.tsx


View more (1)
4. src/features/syntax-analyzer/components/analysis-form/model-choice-group.tsx ✨ Enhancement +6/-6

Update model choice UI with generic names

• Renamed model field values from GPT_4O_MINI_FT/GPT_4O_FT to FAST_FT/PRIMARY
• Updated UI labels to generic Korean names ('기본 모델', '고급 모델')
• Updated decrement count references to use new enum keys
• Maintained recommendation flags and descriptions

src/features/syntax-analyzer/components/analysis-form/model-choice-group.tsx


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Mar 8, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Backend contract risk 🐞 Bug ✓ Correctness
Description
AnalysisModel string literals were changed and are sent verbatim in the analyzer API payload; if the
backend isn’t deployed in lockstep, analysis requests will start failing. The code explicitly
documents that these values must match server-allowed values, but there is no
translation/backward-compat layer.
Code

src/features/syntax-analyzer/constants/settings.ts[R17-26]

export enum AnalysisModel {
-  GPT_4O_MINI_FT = 'gpt-4o-mini-ft',
-  GPT_4O_FT = 'gpt-4o-ft',
+  FAST_FT = 'fast-ft',
+  FAST = 'fast',
+  PRIMARY = 'primary',
}

export const ANALYSIS_DECREMENT_COUNT = {
-  [AnalysisModel.GPT_4O_MINI_FT]: 1,
-  [AnalysisModel.GPT_4O_FT]: 2,
+  [AnalysisModel.FAST_FT]: 1,
+  [AnalysisModel.FAST]: 1,
+  [AnalysisModel.PRIMARY]: 2,
Evidence
The enum values are documented as needing to match server-allowed values, and the API call posts the
selected model as-is (no mapping). Therefore any server/client mismatch in identifiers will directly
break the create-analysis flow.

src/features/syntax-analyzer/constants/settings.ts[16-27]
src/features/syntax-analyzer/api/create-analysis.ts[8-22]
src/features/syntax-analyzer/schemes/analysis-form-schema.ts[11-16]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`AnalysisModel` string literals changed to new identifiers (e.g. `fast-ft`, `primary`), and the client posts these values directly to `POST /analyzer`. If the server contract isn’t updated in lockstep, this will cause immediate request failures.

## Issue Context
The code itself documents that enum values **must match server allowed values**. There is currently no mapping/translation layer in the API client.

## Fix Focus Areas
- src/features/syntax-analyzer/constants/settings.ts[16-27]
- src/features/syntax-analyzer/api/create-analysis.ts[8-22]
- src/features/syntax-analyzer/schemes/analysis-form-schema.ts[11-16]

## Suggested approach
1. Decide the true server contract identifiers:
  - If the server still expects `gpt-4o-mini-ft` / `gpt-4o-ft`, revert the enum *string values* (you can still rename enum member names for readability).
  - If the server now expects `fast-ft` / `primary`, ensure this PR is deployed only after (or together with) the backend change.
2. Consider adding a small mapping layer in `createAnalysis` (or a shared adapter) to support dual-write/compat during rollout if needed:
  - Accept both old and new values in validation (`yup.oneOf([...])`) temporarily, and map to the currently supported server value before posting.
3. Add a comment and/or small unit test ensuring the client’s allowed values align with the expected API contract (so future refactors don’t silently break it).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Schema/UI model mismatch 🐞 Bug ⛯ Reliability
Description
AnalysisModel.FAST is now a valid enum value and allowed by the form schema, but it’s not presented
in the model selection UI. This creates an inconsistent state surface (e.g., programmatic form
manipulation or future option-generation from Object.values).
Code

src/features/syntax-analyzer/constants/settings.ts[R18-20]

+  FAST_FT = 'fast-ft',
+  FAST = 'fast',
+  PRIMARY = 'primary',
Evidence
The enum introduces FAST and the schema allows any enum value, but the UI radio group only offers
FAST_FT and PRIMARY. This means the form can accept/submit a value the UI doesn’t support, which
is an inconsistency and a future footgun.

src/features/syntax-analyzer/constants/settings.ts[17-21]
src/features/syntax-analyzer/schemes/analysis-form-schema.ts[11-16]
src/features/syntax-analyzer/components/analysis-form/model-choice-group.tsx[17-32]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`AnalysisModel` includes `FAST`, and the schema allows it, but the UI doesn’t present it as a selectable option. This mismatch can lead to invalid/unexpected submissions and makes future refactors risky.

## Issue Context
Right now `MODEL_FIELDS` only includes `FAST_FT` and `PRIMARY`, while validation uses `Object.values(AnalysisModel)`.

## Fix Focus Areas
- src/features/syntax-analyzer/constants/settings.ts[16-27]
- src/features/syntax-analyzer/schemes/analysis-form-schema.ts[11-16]
- src/features/syntax-analyzer/components/analysis-form/model-choice-group.tsx[17-32]

## Suggested approach
1. Clarify intent of `FAST`:
  - If it should be user-selectable: add a third radio option and ensure decrement/count semantics are correct.
  - If it’s reserved/internal: remove it from the enum for now, or restrict the schema to only `[AnalysisModel.FAST_FT, AnalysisModel.PRIMARY]`.
2. (Optional hardening) Type `ANALYSIS_DECREMENT_COUNT` as `Record&lt;AnalysisModel, number&gt;` to ensure the mapping stays exhaustive when models change.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment thread src/features/syntax-analyzer/constants/settings.ts
@romantech romantech merged commit 50395d5 into main Mar 8, 2026
5 checks passed
@romantech romantech deleted the ai branch March 8, 2026 10:18
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