mirror of
https://github.com/openai/codex.git
synced 2026-09-13 11:47:17 +00:00
tasks: allow numeric ID only resolving to full slug
This commit is contained in:
@@ -28,7 +28,8 @@ Tasks live under `agentydragon/tasks/` as individual Markdown files. Please upda
|
||||
- **Worktree helper**: in `agentydragon/tasks/`, run:
|
||||
-
|
||||
- ```sh
|
||||
- create-task-worktree.sh [--agent] <task-id>-<task-slug>
|
||||
- # Accept either a full slug (NN-slug) or just the two-digit task ID:
|
||||
- create-task-worktree.sh [--agent] <task-slug|NN>
|
||||
- ```
|
||||
-
|
||||
- Without `--agent`, this creates or reuses a worktree at
|
||||
|
||||
@@ -30,13 +30,27 @@ if [ "$#" -ne 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
task_slug="$1"
|
||||
branch="agentydragon/$task_slug"
|
||||
# Capture raw input so we can accept just a two-digit task ID
|
||||
task_input="$1"
|
||||
|
||||
# Determine repository root
|
||||
# Determine repository root and tasks directory
|
||||
repo_root=$(git rev-parse --show-toplevel)
|
||||
|
||||
tasks_dir="$repo_root/agentydragon/tasks"
|
||||
|
||||
# If given only a two-digit ID, resolve to the full task slug
|
||||
if [[ "$task_input" =~ ^[0-9]{2}$ ]]; then
|
||||
matches=( "$tasks_dir/${task_input}-"*.md )
|
||||
if [ "${#matches[@]}" -eq 1 ]; then
|
||||
task_slug="$(basename "${matches[0]}" .md)"
|
||||
echo "Resolved task ID '$task_input' to slug '$task_slug'"
|
||||
else
|
||||
echo "Error: expected exactly one task file matching '${task_input}-*.md', found ${#matches[@]}" >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
task_slug="$task_input"
|
||||
fi
|
||||
branch="agentydragon/$task_slug"
|
||||
worktrees_dir="$tasks_dir/.worktrees"
|
||||
worktree_path="$worktrees_dir/$task_slug"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user