(Mirror) cli : Use acquire/release semantics for stopping logic#101
(Mirror) cli : Use acquire/release semantics for stopping logic#101ngxson wants to merge 6 commits into
Conversation
📝 WalkthroughWalkthroughThe ChangesModel Parameter Callback & Validation Logic
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tools/cli/cli.cpp`:
- Around line 46-53: The second-interrupt handler uses non-async-signal-safe
functions (fprintf, fflush, std::exit); change it to only call async-signal-safe
primitives: use g_is_interrupted.exchange as-is, then write(2) to STDOUT_FILENO
(or use a literal escape sequence buffer) to clear colors, and call _exit(130)
instead of std::exit; update the block that currently references
g_is_interrupted and the fprintf/fflush/std::exit sequence to use write(...) and
_exit(...) so the signal handler is POSIX async-signal-safe.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
0232f9a to
3d10d0d
Compare
3d10d0d to
453911d
Compare
* ui: model status and load progress via /models/sse feed * ui: centralize SSE wire-format delimiters into shared constants for the chat and /models/sse parsers * ui: type /models/sse event names as a ServerModelsSseEventType enum Address review from allozaur
* server: refactor/generalize input file schema * wire up input_video, accept raw base64 * nits * nits (2) * fix windows
…g#24834) * server: real-time model load progress tracking via /models/sse * update docs * server: move model download to child process * rm unused * fix most problems * clean up * nit fixes * fix test case * do not detact() thread * shorter MODEL_DOWNLOAD_TIMEOUT in test * throttle
Updated model selection prioritization to include favorite models.
Previously, seq_cst ordering was enforced, which is slower and has no benefits when using only one atomic variable.
453911d to
39af19a
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
common/arg.cpp (1)
601-601: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueStale comment: server mode is already excluded by the enclosing block.
The comment "model is required (except for server)" is misleading because this validation runs inside the
if (!skip_model_download)block, which already excludesLLAMA_EXAMPLE_SERVER. The comment suggests there's special server handling in the condition itself, but server mode never reaches this code path.Consider updating the comment to reflect the actual logic, e.g., removing "(except for server)" since server is handled by the outer block.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@common/arg.cpp` at line 601, The comment at line 601 stating "model is required (except for server)" is misleading because server mode is already excluded by the outer if (!skip_model_download) block. Update the comment to remove the "(except for server)" portion since the server mode never reaches this code path due to the enclosing block's logic. The comment should reflect that model validation only applies to the code paths that pass the outer condition.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@common/arg.cpp`:
- Line 601: The comment at line 601 stating "model is required (except for
server)" is misleading because server mode is already excluded by the outer if
(!skip_model_download) block. Update the comment to remove the "(except for
server)" portion since the server mode never reaches this code path due to the
enclosing block's logic. The comment should reflect that model validation only
applies to the code paths that pass the outer condition.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 55523c74-0d14-4dd8-b1fc-b3bfabc8e8aa
📒 Files selected for processing (2)
common/arg.cppcommon/arg.h
@coderabbitai use mirror preset for review
mirror ggml-org#21822
Summary by CodeRabbit
Bug Fixes
Performance
Other