Skip to content

Refactor/188 auto tag song pre fetch#190

Merged
GulSam00 merged 2 commits intodevelopfrom
refactor/188-autoTagSongPreFetch
Apr 12, 2026
Merged

Refactor/188 auto tag song pre fetch#190
GulSam00 merged 2 commits intodevelopfrom
refactor/188-autoTagSongPreFetch

Conversation

@GulSam00
Copy link
Copy Markdown
Owner

📌 PR 제목

[Type] : 작업 내용 요약

📌 변경 사항

💬 추가 참고 사항

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 12, 2026

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

Project Deployment Actions Updated (UTC)
singcode Building Building Preview, Comment Apr 12, 2026 3:29pm

@GulSam00 GulSam00 merged commit 2205afd into develop Apr 12, 2026
1 of 2 checks passed
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Clarify autoTagSong JSON output format and pause tagging workflow

✨ Enhancement 📦 Other

Grey Divider

Walkthroughs

Description
• Add explicit JSON output format instructions to autoTagSong prompt
• Clarify tag_ids array structure in LLM response format
• Temporarily disable tagging song workflow cron schedule
Diagram
flowchart LR
  A["autoTagSong Prompt"] -->|"Add JSON format instructions"| B["Explicit Output Format"]
  B -->|"tag_ids flat array"| C["Structured JSON Response"]
  D["Tagging Workflow"] -->|"Disable cron schedule"| E["Manual Dispatch Only"]
Loading

Grey Divider

File Changes

1. packages/crawling/src/utils/getSongTag.ts ✨ Enhancement +7/-0

Add explicit JSON output format instructions

• Added explicit instruction to return results in JSON format
• Added output instructions section specifying tag_ids key structure
• Clarified that final output must be a flat array in JSON object format
• Provided example JSON format to guide LLM response generation

packages/crawling/src/utils/getSongTag.ts


2. .github/workflows/tagging_song.yml ⚙️ Configuration changes +4/-4

Disable automatic tagging workflow schedule

• Commented out the cron schedule trigger (0 10 * * *)
• Commented out the workflow_dispatch trigger
• Workflow now requires manual triggering through GitHub UI

.github/workflows/tagging_song.yml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Apr 12, 2026

Code Review by Qodo

🐞 Bugs (2)   📘 Rule violations (0)   📎 Requirement gaps (0)   🖥 UI issues (0)   🎨 UX Issues (0)
🐞\ ≡ Correctness (1) ☼ Reliability (1)

Grey Divider


Action required

1. Workflow triggers disabled 🐞
Description
.github/workflows/tagging_song.yml has its entire on: section commented out, so the workflow
will not run on schedule and cannot be manually dispatched. This disables the automated song-tagging
pipeline that the repo documentation says should run daily and be manually runnable.
Code

.github/workflows/tagging_song.yml[R3-6]

+# on:
+#   schedule:
+#     - cron: "0 10 * * *" # 한국 시간 19:00 실행 (UTC+9 → UTC 10:00)
+#   workflow_dispatch:
Evidence
The workflow’s trigger block is commented, meaning GitHub Actions has no events to run it. Repo
documentation explicitly lists this workflow as scheduled and also claims all workflows support
workflow_dispatch, which will no longer be true for this workflow.

.github/workflows/tagging_song.yml[1-7]
packages/crawling/CLAUDE.md[120-130]

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

## Issue description
The GitHub Actions workflow `.github/workflows/tagging_song.yml` has no triggers because the `on:` block (schedule + workflow_dispatch) is commented out. This prevents scheduled runs and manual dispatch, effectively disabling tagging automation.

## Issue Context
`packages/crawling/CLAUDE.md` documents that `tagging_song.yml` runs daily and supports manual dispatch.

## Fix Focus Areas
- .github/workflows/tagging_song.yml[1-7]
- packages/crawling/CLAUDE.md[120-130]

## Suggested fix
- Uncomment/restore the `on:` block with `schedule` and `workflow_dispatch`.
- If disabling is intentional, update `packages/crawling/CLAUDE.md` to reflect the new behavior and provide an alternative execution path.

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



Remediation recommended

2. Invalid JSON example prompt 🐞
Description
autoTagSong’s system prompt includes an invalid JSON example ({"tag_ids":}), while the code
blindly JSON.parses the model response and returns result.tag_ids with no runtime validation. If
the model returns a missing/non-array tag_ids, the tagging cron can crash when it does
tagIds.length.
Code

packages/crawling/src/utils/getSongTag.ts[R77-83]

+            - **Return the final result strictly in JSON format.**
+
+            [Output Instructions]
+            - **Combine all selected IDs into a single flat array.**
+            - **The final output must be a JSON object with a single key "tag_ids".**
+            - **Example: {"tag_ids":}**
+            - **Do not use keys like "language", "genre", or "origin" in the JSON.**
Evidence
The prompt now shows an invalid JSON example. The implementation assumes message.content parses
into { tag_ids: number[] } and returns result.tag_ids without checking it exists/is an array.
The caller in taggingSongs.ts immediately uses tagIds.length, which will throw if autoTagSong
returns undefined due to a missing tag_ids field.

packages/crawling/src/utils/getSongTag.ts[55-106]
packages/crawling/src/cron/taggingSongs.ts[22-36]

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

## Issue description
The LLM prompt contains an invalid JSON example (`{"tag_ids":}`), and `autoTagSong` assumes the response always parses into `{ tag_ids: number[] }` without validating. This can cause runtime errors downstream (e.g., `tagIds.length` in the cron).

## Issue Context
Even with `response_format: { type: 'json_object' }`, the model can still return a JSON object that doesn’t match the expected schema (missing `tag_ids`, `tag_ids` not an array of numbers, etc.).

## Fix Focus Areas
- packages/crawling/src/utils/getSongTag.ts[55-106]
- packages/crawling/src/cron/taggingSongs.ts[22-36]

## Suggested fix
1) Replace the invalid example with a valid one, e.g. `{"tag_ids":[100,200,300]}`.
2) Add runtime validation after parsing:
  - Ensure `result` is an object.
  - Ensure `tag_ids` exists and is an array of numbers.
  - If invalid, return `[]` (and optionally log a structured warning including the raw content).
  - Consider using `zod` (or similar) for a concise schema check.

ⓘ 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 on lines +3 to +6
# on:
# schedule:
# - cron: "0 10 * * *" # 한국 시간 19:00 실행 (UTC+9 → UTC 10:00)
# workflow_dispatch:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Workflow triggers disabled 🐞 Bug ☼ Reliability

.github/workflows/tagging_song.yml has its entire on: section commented out, so the workflow
will not run on schedule and cannot be manually dispatched. This disables the automated song-tagging
pipeline that the repo documentation says should run daily and be manually runnable.
Agent Prompt
## Issue description
The GitHub Actions workflow `.github/workflows/tagging_song.yml` has no triggers because the `on:` block (schedule + workflow_dispatch) is commented out. This prevents scheduled runs and manual dispatch, effectively disabling tagging automation.

## Issue Context
`packages/crawling/CLAUDE.md` documents that `tagging_song.yml` runs daily and supports manual dispatch.

## Fix Focus Areas
- .github/workflows/tagging_song.yml[1-7]
- packages/crawling/CLAUDE.md[120-130]

## Suggested fix
- Uncomment/restore the `on:` block with `schedule` and `workflow_dispatch`.
- If disabling is intentional, update `packages/crawling/CLAUDE.md` to reflect the new behavior and provide an alternative execution path.

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

@GulSam00 GulSam00 deleted the refactor/188-autoTagSongPreFetch branch April 16, 2026 13:26
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