Skip to content

Releases: megamen32/agent-resume

agent-resume v0.1.8

Choose a tag to compare

@megamen32 megamen32 released this 16 Jul 12:07

Changelog

[0.1.8] - 2026-07-16

Release tag: v0.1.8

Changes

  • Merge the main MCP line with the parallel development line.
  • Preserve the intermediate delayed-resume and AgentHerder fixes.
  • Match OpenCode resume markers across user and assistant text parts.
  • Fix the missing uuid import used by job_paths().
  • Include the delayed Codex resume skill and wait_job_status regression test.
  • Keep local OpenCode fork references aligned with the canonical workspace path.

Validation environment

  • OS: Linux x86_64
  • Python: 3.10.12
  • Node.js: 22.22.3
  • npm: 10.9.8
  • pytest: 8.4.2
  • Git: 2.34.1

Validation commands

  • python3 -m py_compile agent_resume.py scripts/install-client-configs.py scripts/test-codex-paid-smoke.py tests/test_wait_job_status.py — passed
  • node --check npm/agent-resume-mcp.js — passed
  • python3 -m pytest -q tests1 passed
  • npm pack --dry-run — passed; package agent-resume-mcp@0.1.8
  • git diff --check — passed

agent-resume v0.1.7 — built-in wait/resume watchers

Choose a tag to compare

@megamen32 megamen32 released this 05 Jul 03:43

agent-resume v0.1.7 — built-in wait/resume watchers

Adds built-in long-wait tools so agent-resume can replace Notify for wait/resume flows:

  • run_and_resume — run a command, wait for exit/timeout, then resume the same chat.
  • attach_pid_and_resume — watch an existing PID, then resume.
  • attach_query_and_resume — find a process by command substring, watch, then resume.
  • wait_and_resume — wait a fixed duration, then resume.
  • wait_job_status — inspect wait job state.

Codex captures the current thread id from MCP _meta.threadId before detaching. OpenCode uses cwd + marker. execute_resume=true by default; set execute_resume=false only for tests.

The installer now defaults to Codex + OpenCode. Claude remains supported as an explicit fallback, but is not installed by default because Claude can resume itself.

agent-resume v0.1.6 — skipped paid Codex smoke test

Choose a tag to compare

@megamen32 megamen32 released this 05 Jul 03:05

agent-resume v0.1.6 — skipped paid Codex smoke test

Added

  • scripts/test-codex-paid-smoke.py
  • npm run test:codex-paid

The test is skipped by default because it runs a paid Codex model call.
Enable explicitly:

AGENT_RESUME_RUN_PAID_CODEX=1 AGENT_RESUME_CODEX_MODEL=gpt-5.4-mini npm run test:codex-paid

The test asserts that Codex calls agent_resume.build_resume_command without cwd and without marker, and verifies:

  • session_id_source == "mcp_meta"
  • marker == null
  • used_last == false
  • command is the full argv array beginning with codex exec resume <thread_id>

Notes

used_last: false means the unsafe --last path was not used. command is the full argv list returned by agent-resume; earlier summaries may show only its prefix for readability.

agent-resume v0.1.5 — Codex meta and required marker fallback

Choose a tag to compare

@megamen32 megamen32 released this 05 Jul 02:56

agent-resume v0.1.5 — Codex _meta session id + marker-required fallback

Changed

  • Codex no longer needs a marker: agent-resume reads the session/thread id from MCP request _meta.threadId.
  • OpenCode and Claude use cwd + marker; their MCP clients do not provide a documented session id to tool calls.
  • MCP tools/list now specializes the build_resume_command schema by AGENT_RESUME_AGENT:
    • codex: no marker required.
    • opencode / claude: cwd and marker are required.
    • generic/no default agent: explicit session_id or cwd + marker.
  • use_last remains disabled.

Marker

For OpenCode/Claude, marker is a plain required tool argument:

[A-Za-z0-9]{5}

Example: Q7xK2.

agent-resume v0.1.4 — short marker matching

Choose a tag to compare

@megamen32 megamen32 released this 05 Jul 02:38

agent-resume v0.1.4 — short marker matching

Changed

  • Replaced timestamp/UUID-first correlation with a simple marker.
  • Accepted marker format: exactly 5 ASCII alphanumeric chars [A-Za-z0-9]{5}.
  • The MCP server records called_at_ms itself, so the model does not need to know current time.
  • use_last is disabled for resume matching; it can wake the wrong chat.
  • build_resume_command now requires marker unless explicit session_id is provided.
  • If no candidate has an exact marker match (score >= 100), resume is refused.

Example

MARKER=Q7xK2
opencode run --title "agent-resume-$MARKER" "Do the task. Marker: $MARKER"
AGENT_RESUME_AGENT=opencode ./agent_resume.py resume --cwd "$PWD" --marker "$MARKER" --job-id job-123 --log-file /tmp/job.log

agent-resume v0.1.3 — safe run_id matching

Choose a tag to compare

@megamen32 megamen32 released this 05 Jul 02:21

agent-resume v0.1.3 — safe run_id matching

New safety rule

build_resume_command now requires run_id unless session_id is explicit or use_last=true.

Accepted run_id formats:

  • 13-digit epoch milliseconds, e.g. 1783217856841
  • UUID4

If no candidate has an exact run_id match (score >= 100), agent-resume refuses to fall back to --last.

Why

This prevents waking the wrong chat when multiple sessions share the same cwd or similar title.

OpenCode note

Custom/local OpenCode builds can write to opencode-<channel>.db. Use:

export OPENCODE_DISABLE_CHANNEL_DB=true

to force the standard database ~/.local/share/opencode/opencode.db.

agent-resume v0.1.2 — client config installer

Choose a tag to compare

@megamen32 megamen32 released this 05 Jul 01:59

agent-resume v0.1.2 — client config installer

New

  • Added scripts/install-client-configs.py.
  • Installs ready-to-use MCP config entries for:
    • Codex: AGENT_RESUME_AGENT=codex
    • OpenCode: AGENT_RESUME_AGENT=opencode
    • Claude Code: AGENT_RESUME_AGENT=claude
  • OpenCode JSONC is patched minimally to preserve existing formatting/comments/secrets.

Install examples

python3 scripts/install-client-configs.py codex opencode claude

Codex config entry:

[mcp_servers.agent_resume]
command = "npx"
args = ["-y", "github:megamen32/agent-resume"]
env = { "AGENT_RESUME_AGENT" = "codex" }
enabled = true

OpenCode config entry uses environment.AGENT_RESUME_AGENT = "opencode".
Claude Code config entry uses env.AGENT_RESUME_AGENT = "claude".

Validation on roomhacker-server-100

  • codex mcp list: agent_resume enabled, env masked.
  • opencode mcp list: agent-resume connected.
  • claude mcp list: agent-resume connected.
  • Direct MCP handshakes with AGENT_RESUME_AGENT=codex|opencode|claude: OK.

agent-resume v0.1.1 — configured agent identity

Choose a tag to compare

@megamen32 megamen32 released this 05 Jul 01:54

agent-resume v0.1.1

Fixes design issue

The model no longer needs to pass agent=codex|opencode|claude on every call.
Configure the MCP server once with:

AGENT_RESUME_AGENT=codex
AGENT_RESUME_AGENT=opencode
AGENT_RESUME_AGENT=claude

or use ~/.config/agent-resume/config.json:

{ "agent": "codex" }

Better SESSION_ID detection

Codex now prefers the real state DB:

~/.codex/state_5.sqlite
  table: threads
  id           -> SESSION_ID
  cwd          -> project match
  rollout_path -> transcript file

Fallback remains ~/.codex/session_index.jsonl.

OpenCode still uses SQLite session tables from ~/.local/share/opencode/*.db.
Claude Code still scans ~/.claude/projects/<encoded-cwd>/*.jsonl.

Source review

README now documents the exact source findings from:

  • /home/roomhacker/src/codex
  • /home/roomhacker/.config/opencode/apps/forks/opencode

agent-resume v0.1.0

Choose a tag to compare

@megamen32 megamen32 released this 05 Jul 00:58

agent-resume v0.1.0

Initial MVP.

What it does

  • Finds likely local sessions for agent=codex|opencode|claude.
  • Builds dry-run resume commands by default.
  • Can launch resume commands detached with execute=true.
  • Exposes MCP tools:
    • find_sessions
    • build_resume_command
    • register_agent

Resume backends

  • Codex: codex exec resume <session|--last> "prompt"
  • OpenCode: opencode --session <id> --prompt "prompt" or --continue
  • Claude Code: claude --print --resume <id> "prompt" or --continue

Install

npx -y github:megamen32/agent-resume

The tool is safe by default: it returns the command it would run unless execute=true is explicitly set.