feat(workflows): add thread workflow delete RPC and enable TUI Delete action#143
Open
andrei-hasna wants to merge 2 commits into
Conversation
… action
Add a thread/workflow/delete app-server RPC and wire the /workflows manager
Delete action to it.
- Protocol: ThreadWorkflowDeleteParams/Response, registered as the experimental
thread/workflow/delete method alongside create/get/list; extend the
experimental-marker test.
- State: WorkflowStore::delete_thread_workflow_spec returns a
WorkflowSpecDeleteOutcome (Deleted/NotFound/BlockedByActiveRun). Deletion is
thread-scoped, refuses specs with a non-terminal run, and cascades terminal
runs by enabling foreign_keys for the delete connection then restoring the
default so the pooled connection is not left enforcing FKs.
- App-server: thread_workflow_delete processor maps the outcome to
{ deleted: bool }; active-run conflicts become invalid_request. The bool
response preserves raw YAML/prompt redaction.
- TUI: enable the previously-disabled Delete item with a Yes/No confirmation
step; on success refresh the manager so the spec disappears.
- Tests: state (success/missing/thread-scoped/active-run guard), app-server
(success + missing, no-leak), and codex-tui (delete dispatch + confirm/cancel).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds first-class workflow spec deletion so the
/workflowsmanager can enable its previously-disabled Delete action.codex-app-server-protocol): new experimentalthread/workflow/deleteRPC withThreadWorkflowDeleteParams { thread_id, workflow_record_id }→ThreadWorkflowDeleteResponse { deleted: bool }, registered next to create/get/list. The bool response preserves raw YAML / prompt redaction (never re-serializes the spec body).codex-state):WorkflowStore::delete_thread_workflow_specreturnsWorkflowSpecDeleteOutcome(Deleted/NotFound/BlockedByActiveRun). It is thread-scoped, refuses specs that still own a non-terminal run (so an in-flight run is never yanked), and cascades terminal runs by enablingPRAGMA foreign_keysfor the delete connection then restoring the default so the pooled connection is not left enforcing FKs.thread_workflow_deleteprocessor mirrorsget;Deleted→deleted:true,NotFound→deleted:false(no error),BlockedByActiveRun→invalid_request.codex-tui): the Delete spec action is enabled with a Yes/No confirmation step; on success the manager refreshes so the deleted spec disappears.Design notes
deleted:falserather than erroring (idempotent delete).schema_fixturestests).Testing
cargo test -p codex-app-server-protocol(incl. schema fixtures) — passcargo test -p codex-state workflows(success / missing / thread-scoped / active-run guard) — passcargo test -p codex-app-server --test all v2::workflow(delete success + missing, no-leak) — passcargo test -p codex-tui workflow(delete dispatch + confirm/cancel) — passcargo clippy+cargo fmt --checkon touched crates — clean🤖 Generated with Claude Code