fix(config): reject malformed cross_project_learnings at set

A typo was stored with exit 0, so the feature stayed off and the first-run prompt never returned. Reject like codex_reviews; do not coerce.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
y$un_
2026-08-31 20:56:32 +00:00
committed by Garry Tan
co-authored by Cursor
parent 6b9f10a8b7
commit 3599a3d4df
2 changed files with 75 additions and 0 deletions
+8
View File
@@ -403,6 +403,14 @@ case "${1:-}" in
echo "Error: codex_reviews '$VALUE' not recognized. Valid values: enabled, disabled. Existing value left unchanged." >&2
exit 1
fi
# cross_project_learnings: empty get is the first-run prompt sentinel.
# Skills enable only on the literal "true". A typo must not persist — that
# keeps the feature off and suppresses the prompt. Reject, like
# codex_reviews; do not coerce (a stored default still kills the sentinel).
if [ "$KEY" = "cross_project_learnings" ] && [ "$VALUE" != "true" ] && [ "$VALUE" != "false" ]; then
echo "Error: cross_project_learnings '$VALUE' not recognized. Valid values: true, false. Existing value left unchanged." >&2
exit 1
fi
mkdir -p "$STATE_DIR"
# Write annotated header on first creation
if [ ! -f "$CONFIG_FILE" ]; then