fix: Migrate review-pr.sh to SDK + pr-lifecycle (#800)
Move SID_FILE recovery into agent_recover_session() in lib/agent-sdk.sh to eliminate remaining duplicate block between dev-agent.sh and review-pr.sh. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c2e95799a0
commit
8f41230fa0
3 changed files with 12 additions and 10 deletions
|
|
@ -12,13 +12,21 @@
|
|||
# agent_run [--resume SESSION_ID] [--worktree DIR] PROMPT
|
||||
#
|
||||
# After each call, _AGENT_SESSION_ID holds the session ID (also saved to SID_FILE).
|
||||
# Recover a previous session on startup:
|
||||
# if [ -f "$SID_FILE" ]; then _AGENT_SESSION_ID=$(cat "$SID_FILE"); fi
|
||||
# Call agent_recover_session() on startup to restore a previous session.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
_AGENT_SESSION_ID=""
|
||||
|
||||
# agent_recover_session — restore session_id from SID_FILE if it exists.
|
||||
# Call this before agent_run --resume to enable session continuity.
|
||||
agent_recover_session() {
|
||||
if [ -f "$SID_FILE" ]; then
|
||||
_AGENT_SESSION_ID=$(cat "$SID_FILE")
|
||||
log "agent_recover_session: ${_AGENT_SESSION_ID:0:12}..."
|
||||
fi
|
||||
}
|
||||
|
||||
# agent_run — synchronous Claude invocation (one-shot claude -p)
|
||||
# Usage: agent_run [--resume SESSION_ID] [--worktree DIR] PROMPT
|
||||
# Sets: _AGENT_SESSION_ID (updated each call, persisted to SID_FILE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue