fix: execution limits, checkpoints, local issue handling, and shellcheck fix #4
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
riley/codetether-action!4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/execution-limits-and-checkpoints"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Clean replacement for PR #2 (which had merge conflicts and a shellcheck parse error).
Changes
max_steps30→50,task_wait_seconds1200→3600max_stepsandtask_timeout_secondsto server-side agentcheckpoint()function with elapsed time and remaining budget trackingemergency_push_and_exit()for time budget exhaustionhandle_issue_local()— full branch→edit→commit→push→PR workflow in local modetimeout_minutesin action.ymlCODETETHER_TIME_BUDGETarithmetic expressionBug Fixed
$((INPUT_TIMEOUT_MINUTES:-30) * 60))had mismatched parentheses — replaced with$(( INPUT_TIMEOUT_MINUTES * 60 ))(INPUT_TIMEOUT_MINUTES defaults via action.yml).CI
Shellcheck now passes with zero errors (only pre-existing warnings/info).
Pull request overview
This PR updates the CodeTether GitHub Action to increase execution budgets, add structured “checkpoint” logging for time/budget awareness, and expand local-mode support to handle Issues end-to-end (branch → edit → commit → push → PR).
Changes:
max_steps/task_timeout_secondsinto server dispatch metadata.checkpoint()(elapsed/remaining budget logging) and integrated checkpoints across server/local/GitHub helpers.handle_issue_local) and a newtimeout_minutesaction input intended for job-level budgeting.Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
checkpoint(), and emergency push helper; adds finalize checkpoint.max_steps,task_wait_seconds) and adds newtimeout_minutesinput.💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@ -70,4 +75,3 @@default: "1200"version:description: "CodeTether version to install (local mode only)"required: falseThe new
timeout_minutesinput isn’t currently exported to the runtime environment for the bash scripts (there is noINPUT_TIMEOUT_MINUTESin theRun reviewstep env). Sincecommon.shnow consumesINPUT_TIMEOUT_MINUTESunderset -u, the action will crash at startup unless this env var is wired through.@ -137,6 +142,7 @@ ${review_text}"log_info "Response posted to Issue #${PR_NUMBER}"fifihandle_issue_local()always terminates the process viaexiton all paths, so thereturn $?immediately after calling it is unreachable. Either havehandle_issue_localreturn a status instead of exiting, or just call it withoutreturnto keep control flow clear.@ -42,0 +44,4 @@CODETETHER_START_EPOCH="${CODETETHER_START_EPOCH:-$(date +%s)}"# Default budget in seconds (GitHub Actions job timeout, configurable)# INPUT_TIMEOUT_MINUTES defaults to 30 via action.yml; guard for non-Actions contexts.INPUT_TIMEOUT_MINUTES="${INPUT_TIMEOUT_MINUTES:-30}"common.shruns withset -u, butCODETETHER_TIME_BUDGETis computed fromINPUT_TIMEOUT_MINUTESwithout a default expansion. IfINPUT_TIMEOUT_MINUTESis not exported (it currently isn’t inaction.yml’s Run review env), sourcing this file will fail with an “unbound variable” error. Use a safe default (e.g.,${INPUT_TIMEOUT_MINUTES:-30}) and/or validate it is numeric before arithmetic expansion.@ -48,0 +67,4 @@echo "::error::$(github_actions_escape "$raw_msg")"}# ── Debug checkpoint with elapsed time and remaining budget ─────checkpoint()computestsbut never uses it (the log line usesdate -Isecondsinstead). This is dead code; removetsor switch the message to use it to avoid confusion and keep shellcheck clean.@ -48,0 +108,4 @@log_warn "EMERGENCY PUSH: ${reason}"# Stage any uncommitted changesif [ -n "$(git status --short 2>/dev/null)" ]; thenemergency_push_and_exit()is documented (and named) as if it will exit after attempting the push, but it currently only logs and returns to the caller. Either make it actually terminate (exit with a non-zero code or a provided code) or rename/update the docstring to match the current behavior so callers don’t assume it stops execution.In
poll_task_result(), the comment says checkpoints are logged every 10 polls to avoid log spam, but theelsebranch still logs a line on every poll viatee -a. If the intent is to reduce log volume during long waits, consider only logging on the checkpoint cadence (or gate per-poll logging behind a debug flag).Code Review
This pull request introduces a checkpointing system and time-budget tracking to improve the observability of the action's execution. It refactors local-mode issue handling into a dedicated library that automates the branch-to-PR workflow and updates several default configuration values. A suggestion was made to harden the time budget calculation against unset variables to avoid shell errors.
@ -42,0 +44,4 @@CODETETHER_START_EPOCH="${CODETETHER_START_EPOCH:-$(date +%s)}"# Default budget in seconds (GitHub Actions job timeout, configurable)# INPUT_TIMEOUT_MINUTES defaults to 30 via action.yml; guard for non-Actions contexts.INPUT_TIMEOUT_MINUTES="${INPUT_TIMEOUT_MINUTES:-30}"The arithmetic expression for CODETETHER_TIME_BUDGET uses a variable that might be unset or empty. While the default is handled, it is safer to ensure INPUT_TIMEOUT_MINUTES is treated as an integer to avoid potential shell errors if it contains non-numeric characters.