Codex-generated pull request#146
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 806cf4dca0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| relative = kv_rel_dir or (kid or "").strip().lower() | ||
| if not relative: | ||
| raise ValueError("legacy replica location must not be empty") | ||
| candidate = (root / relative).resolve() |
There was a problem hiding this comment.
Inspect the same directory used by KV injection
When legacy kv_rel_dir is stale, corrupted, . or points to another existing cache directory, this wrapper reports the replica as healthy because it checks <kv_root>/<kv_rel_dir>. The actual injection path explicitly ignores this field and loads <kv_root>/<kid> in kdn_server/kdn_api.py:875-876, so the health view can claim readiness while injection fails with a missing manifest. Base the filesystem check on the runtime kid directory, or report a mismatch rather than treating the unrelated directory as healthy.
AGENTS.md reference: AGENTS.md:L227-L230
Useful? React with 👍 / 👎.
| class _StateModel(BaseModel): | ||
| model_config = ConfigDict(extra="forbid") |
There was a problem hiding this comment.
Make lifecycle models immutable
Because _StateModel uses Pydantic's default mutable model configuration, callers can execute assignments such as artifact.state = ArtifactState.READY or change a terminal DELETED object back to another state without invoking transition_to. Such objects then serialize normally, bypassing _TRANSITIONS, terminal-state checks, and structured transition errors. Freeze these lifecycle models, or otherwise prevent direct state assignment, so the advertised transition contract cannot be bypassed accidentally.
Useful? React with 👍 / 👎.
Codex generated this pull request, but encountered an unexpected error after generation. This is a placeholder PR message.
Codex Task