Compare commits

...

2 Commits

Author SHA1 Message Date
Michael Bolin
5e87e4ba5e Publish stable DotSlash assets for argument-comment lint 2026-03-18 15:57:29 -07:00
Eric Traut
e5de13644d Add a startup deprecation warning for custom prompts (#15076)
## Summary
- detect custom prompts in `$CODEX_HOME/prompts` during TUI startup
- show a deprecation notice only when prompts are present, with guidance
to use `$skill-creator`
- add TUI tests and snapshot coverage for present, missing, and empty
prompts directories

## Testing
- Manually tested
2026-03-18 15:21:30 -06:00
6 changed files with 222 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
{
"outputs": {
"argument-comment-lint": {
"platforms": {
"macos-aarch64": {
"regex": "^libargument_comment_lint@nightly-2025-09-18-aarch64-apple-darwin\\.dylib\\.zst$",
"path": "libargument_comment_lint@nightly-2025-09-18-aarch64-apple-darwin.dylib"
},
"linux-x86_64": {
"regex": "^libargument_comment_lint@nightly-2025-09-18-x86_64-unknown-linux-gnu\\.so\\.zst$",
"path": "libargument_comment_lint@nightly-2025-09-18-x86_64-unknown-linux-gnu.so"
},
"linux-aarch64": {
"regex": "^libargument_comment_lint@nightly-2025-09-18-aarch64-unknown-linux-gnu\\.so\\.zst$",
"path": "libargument_comment_lint@nightly-2025-09-18-aarch64-unknown-linux-gnu.so"
},
"windows-x86_64": {
"regex": "^argument_comment_lint@nightly-2025-09-18-x86_64-pc-windows-msvc\\.dll\\.zst$",
"path": "argument_comment_lint@nightly-2025-09-18-x86_64-pc-windows-msvc.dll"
}
}
}
}
}

View File

@@ -0,0 +1,88 @@
name: rust-release-argument-comment-lint
on:
workflow_call:
inputs:
publish:
required: true
type: boolean
jobs:
skip:
if: ${{ !inputs.publish }}
runs-on: ubuntu-latest
steps:
- run: echo "Skipping argument-comment-lint release assets for prerelease tag"
build:
if: ${{ inputs.publish }}
name: Build - ${{ matrix.runner }} - ${{ matrix.target }}
runs-on: ${{ matrix.runs_on || matrix.runner }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- runner: macos-15-xlarge
target: aarch64-apple-darwin
lib_name: libargument_comment_lint@nightly-2025-09-18-aarch64-apple-darwin.dylib
- runner: ubuntu-24.04
target: x86_64-unknown-linux-gnu
lib_name: libargument_comment_lint@nightly-2025-09-18-x86_64-unknown-linux-gnu.so
- runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
lib_name: libargument_comment_lint@nightly-2025-09-18-aarch64-unknown-linux-gnu.so
- runner: windows-x64
target: x86_64-pc-windows-msvc
lib_name: argument_comment_lint@nightly-2025-09-18-x86_64-pc-windows-msvc.dll
runs_on:
group: codex-runners
labels: codex-windows-x64
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@1.93.0
with:
toolchain: nightly-2025-09-18
targets: ${{ matrix.target }}
components: llvm-tools-preview, rustc-dev, rust-src
- name: Install dylint-link
shell: bash
run: cargo install --locked dylint-link
- name: Cargo build
working-directory: tools/argument-comment-lint
shell: bash
run: cargo build --release --target ${{ matrix.target }}
- if: ${{ runner.os == 'Windows' }}
name: Install DotSlash
uses: facebook/install-dotslash@v2
- name: Stage artifact
shell: bash
run: |
dest="dist/argument-comment-lint/${{ matrix.target }}"
mkdir -p "$dest"
cp "tools/argument-comment-lint/target/${{ matrix.target }}/release/${{ matrix.lib_name }}" \
"$dest/${{ matrix.lib_name }}"
- if: ${{ runner.os != 'Windows' }}
name: Compress artifact
shell: bash
run: |
zstd -T0 -19 --rm "dist/argument-comment-lint/${{ matrix.target }}/${{ matrix.lib_name }}"
- if: ${{ runner.os == 'Windows' }}
name: Compress artifact
shell: bash
run: |
./.github/workflows/zstd -T0 -19 --rm "dist/argument-comment-lint/${{ matrix.target }}/${{ matrix.lib_name }}"
- uses: actions/upload-artifact@v7
with:
name: argument-comment-lint-${{ matrix.target }}
path: dist/argument-comment-lint/${{ matrix.target }}/*

View File

@@ -380,11 +380,19 @@ jobs:
publish: true
secrets: inherit
argument-comment-lint-release-assets:
name: argument-comment-lint release assets
needs: tag-check
uses: ./.github/workflows/rust-release-argument-comment-lint.yml
with:
publish: ${{ !contains(github.ref_name, '-') }}
release:
needs:
- build
- build-windows
- shell-tool-mcp
- argument-comment-lint-release-assets
name: release
runs-on: ubuntu-latest
permissions:
@@ -521,6 +529,14 @@ jobs:
tag: ${{ github.ref_name }}
config: .github/dotslash-config.json
- if: ${{ !contains(steps.release_name.outputs.name, '-') }}
uses: facebook/dotslash-publish-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ github.ref_name }}
config: .github/dotslash-argument-comment-lint-config.json
- name: Trigger developers.openai.com deploy
# Only trigger the deploy if the release is not a pre-release.
# The deploy is used to update the developers.openai.com website with the new config schema json file.

View File

@@ -285,6 +285,32 @@ fn emit_missing_system_bwrap_warning(app_event_tx: &AppEventSender) {
)));
}
async fn emit_custom_prompt_deprecation_notice(app_event_tx: &AppEventSender, codex_home: &Path) {
let prompts_dir = codex_home.join("prompts");
let prompt_count = codex_core::custom_prompts::discover_prompts_in(&prompts_dir)
.await
.len();
if prompt_count == 0 {
return;
}
let prompt_label = if prompt_count == 1 {
"prompt"
} else {
"prompts"
};
let details = format!(
"Detected {prompt_count} custom {prompt_label} in `$CODEX_HOME/prompts`. Use the `$skill-creator` skill to convert each custom prompt into a skill."
);
app_event_tx.send(AppEvent::InsertHistoryCell(Box::new(
history_cell::new_deprecation_notice(
"Custom prompts are deprecated and will soon be removed.".to_string(),
Some(details),
),
)));
}
#[derive(Debug, Clone, PartialEq, Eq)]
struct SessionSummary {
usage_line: String,
@@ -1974,6 +2000,7 @@ impl App {
let app_event_tx = AppEventSender::new(app_event_tx);
emit_project_config_warnings(&app_event_tx, &config);
emit_missing_system_bwrap_warning(&app_event_tx);
emit_custom_prompt_deprecation_notice(&app_event_tx, &config.codex_home).await;
tui.set_notification_method(config.tui_notification_method);
let harness_overrides =
@@ -4324,6 +4351,62 @@ mod tests {
);
}
fn render_history_cell(cell: &dyn HistoryCell, width: u16) -> String {
cell.display_lines(width)
.into_iter()
.map(|line| line.to_string())
.collect::<Vec<_>>()
.join("\n")
}
#[tokio::test]
async fn startup_custom_prompt_deprecation_notice_emits_when_prompts_exist() -> Result<()> {
let codex_home = tempdir()?;
let prompts_dir = codex_home.path().join("prompts");
std::fs::create_dir_all(&prompts_dir)?;
std::fs::write(prompts_dir.join("review.md"), "# Review\n")?;
let (tx_raw, mut rx) = unbounded_channel();
let app_event_tx = AppEventSender::new(tx_raw);
emit_custom_prompt_deprecation_notice(&app_event_tx, codex_home.path()).await;
let cell = match rx.try_recv() {
Ok(AppEvent::InsertHistoryCell(cell)) => cell,
other => panic!("expected InsertHistoryCell event, got {other:?}"),
};
let rendered = render_history_cell(cell.as_ref(), 120);
assert_snapshot!("startup_custom_prompt_deprecation_notice", rendered);
assert!(rx.try_recv().is_err(), "expected only one startup notice");
Ok(())
}
#[tokio::test]
async fn startup_custom_prompt_deprecation_notice_skips_missing_prompts_dir() -> Result<()> {
let codex_home = tempdir()?;
let (tx_raw, mut rx) = unbounded_channel();
let app_event_tx = AppEventSender::new(tx_raw);
emit_custom_prompt_deprecation_notice(&app_event_tx, codex_home.path()).await;
assert!(rx.try_recv().is_err(), "expected no startup notice");
Ok(())
}
#[tokio::test]
async fn startup_custom_prompt_deprecation_notice_skips_empty_prompts_dir() -> Result<()> {
let codex_home = tempdir()?;
std::fs::create_dir_all(codex_home.path().join("prompts"))?;
let (tx_raw, mut rx) = unbounded_channel();
let app_event_tx = AppEventSender::new(tx_raw);
emit_custom_prompt_deprecation_notice(&app_event_tx, codex_home.path()).await;
assert!(rx.try_recv().is_err(), "expected no startup notice");
Ok(())
}
#[test]
fn startup_waiting_gate_not_applied_for_resume_or_fork_session_selection() {
let wait_for_resume = App::should_wait_for_initial_session(&SessionSelection::Resume(

View File

@@ -0,0 +1,7 @@
---
source: tui/src/app.rs
expression: rendered
---
⚠ Custom prompts are deprecated and will soon be removed.
Detected 1 custom prompt in `$CODEX_HOME/prompts`. Use the `$skill-creator` skill to convert each custom prompt into
a skill.

View File

@@ -68,6 +68,10 @@ cd tools/argument-comment-lint
cargo test
```
Stable GitHub releases also publish a DotSlash file named
`argument-comment-lint` for the prebuilt library on macOS arm64, Linux arm64,
Linux x64, and Windows x64.
Run the lint against `codex-rs` from the repo root:
```bash