Skip to content

Add self-update, conversion previews, and resume recipes#4

Merged
aytzey merged 1 commit into
mainfrom
feat/self-update-preview-recipes
Jul 9, 2026
Merged

Add self-update, conversion previews, and resume recipes#4
aytzey merged 1 commit into
mainfrom
feat/self-update-preview-recipes

Conversation

@aytzey

@aytzey aytzey commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • add showagent update plus a release-build startup prompt that asks before installing a newer release
  • add safe hand-off previews: TUI x now previews first and confirms on the second press; CLI gets showagent convert ... --dry-run
  • add showagent info and resume recipes so users can see the exact provider command and storage location
  • address CodeRabbit follow-ups from PR showagent 0.7.0 — every agent, every OS #1: checkout credential persistence, Codex delete timeout, OpenCode JSON decoding, provider empty-state copy, and local key shadowing
  • refresh README/demo assets for the preview-confirm flow

Fixes #2
Fixes #3

CodeRabbit Follow-Up

  • .github/workflows/{ci,release}.yml: actions/checkout now uses persist-credentials: false
  • internal/session/codex.go: codex delete is bounded by a 30s context timeout
  • internal/session/opencode.go: JSON decoding now ignores banner lines instead of grabbing stray [ characters inside status text
  • cmd/showagent/main.go and TUI empty state: no longer mention only Codex/Claude
  • golang.org/x/sys v0.47.0: verified as published on the Go proxy; no code change needed

Validation

  • docker run --rm -v "$PWD":/src -w /src golang:1.25.9 sh -lc 'export PATH=/usr/local/go/bin:$PATH; go vet ./... && go test ./... -race && go build -buildvcs=false ./cmd/showagent'
  • docker run --rm -v "$PWD":/src -w /src golangci/golangci-lint:v2.12.2 golangci-lint run
  • docker run --rm -v "$PWD":/src -w /src golang:1.25.9 sh -lc 'export PATH=/usr/local/go/bin:$PATH; for target in linux/amd64 darwin/amd64 darwin/arm64 windows/amd64; do GOOS=${target%/*} GOARCH=${target#*/} CGO_ENABLED=0 go build -buildvcs=false ./cmd/showagent; done'
  • git diff --check

Post-Deploy Monitoring & Validation

  • No service runtime to monitor; this is a local CLI release.
  • After merge/tag, verify the release workflow publishes archives plus SHA256SUMS, then run showagent update --check and showagent update against the new tag from an older local binary.

Summary by CodeRabbit

  • New Features

    • Added convert command with --dry-run preview mode and --scope flag for trimming conversations before conversion
    • Modified x key behavior: now previews conversion first, then confirms with another press
    • Added info command to display session details
    • Added update command to check and install updates
  • Documentation

    • Updated README with conversion workflow, updated keybindings, and FAQ clarifications
    • Updated demo documentation to reflect new preview-then-confirm behavior

@aytzey aytzey merged commit 5cf5b10 into main Jul 9, 2026
5 checks passed
@aytzey aytzey deleted the feat/self-update-preview-recipes branch July 9, 2026 11:47
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4d464fd2-1c89-48b4-9d5a-043df291ac25

📥 Commits

Reviewing files that changed from the base of the PR and between fce230a and f5ca56e.

⛔ Files ignored due to path filters (2)
  • docs/demo.gif is excluded by !**/*.gif
  • docs/social-preview.png is excluded by !**/*.png
📒 Files selected for processing (18)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • README.md
  • cmd/showagent/main.go
  • cmd/showagent/main_test.go
  • cmd/showagent/update.go
  • cmd/showagent/update_test.go
  • demo/README.md
  • demo/demo.tape
  • internal/session/codex.go
  • internal/session/opencode.go
  • internal/session/opencode_test.go
  • internal/session/provider.go
  • internal/session/recipe.go
  • internal/session/session_test.go
  • internal/tui/keys.go
  • internal/tui/tui.go
  • internal/tui/tui_test.go

📝 Walkthrough

Walkthrough

Adds a dry-run conversion preview and resume-recipe feature spanning session logic, CLI (convert, info), and TUI (preview-then-write flow); introduces a showagent update self-update command; hardens CI checkout credential persistence; and fixes codex delete timeouts and opencode JSON parsing.

Changes

Conversion Preview and Resume Recipe

Layer / File(s) Summary
Preview/recipe data model and core logic
internal/session/recipe.go, internal/session/provider.go, internal/session/session_test.go
Adds ConversionPreview/ResumeRecipe types, PreviewConversion/RecipeFor logic, ParseProvider/ProviderNames helpers, and tests validating preview turns/dropped-content and recipe command quoting/storage location.
CLI convert and info commands
cmd/showagent/main.go, cmd/showagent/main_test.go
Adds runConvert/runInfo, --scope/--dry-run parsing, dispatcher wiring, updated help text with dynamic provider list, and tests for dry-run preview and info output.
TUI conversion preview and confirm flow
internal/tui/tui.go, internal/tui/keys.go, internal/tui/tui_test.go
Introduces pendingConversion state, conversionPreviewMsg handling, preview rendering in detailView, clearing logic across UI transitions, updated key help text, and busy-state/preview tests.
Documentation for preview/write flow
README.md, demo/README.md, demo/demo.tape
Updates quick start, keybindings, scripting, and FAQ sections plus the demo tape/readme to describe the two-press preview-then-write conversion flow.

Self-Update Mechanism

Layer / File(s) Summary
Update command implementation and tests
cmd/showagent/update.go, cmd/showagent/update_test.go, cmd/showagent/main.go, cmd/showagent/main_test.go, README.md
Implements runUpdate, maybePromptForUpdate, GitHub release fetching, asset selection, checksum verification, archive extraction, atomic binary install, version comparison, plus update-check tests and README network-behavior documentation.

CI Credential Hardening and Provider Fixes

Layer / File(s) Summary
CI checkout persist-credentials hardening
.github/workflows/ci.yml, .github/workflows/release.yml
Adds persist-credentials: false to actions/checkout steps across CI and release workflow jobs.
Codex delete timeout and opencode JSON parsing fix
internal/session/codex.go, internal/session/opencode.go, internal/session/opencode_test.go
Adds a 30s timeout with deadline-error handling to codex session deletion, and switches opencode JSON decoding to a line-based scan to avoid false-positive JSON detection from banner text, with a regression test.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant TUI as TUI Model
  participant Session as PreviewConversion
  participant Recipe as RecipeFor

  User->>TUI: press x (first time)
  TUI->>Session: previewConversion(row, target, options)
  Session-->>TUI: conversionPreviewMsg(preview)
  TUI->>TUI: store pendingConvert, show "press x again" hint
  User->>TUI: press x (second time)
  TUI->>TUI: startConvert() detects matching pendingConvert
  TUI->>Session: convertRow(commit)
  Session-->>TUI: write converted session
  TUI->>Recipe: RecipeFor(new row)
  Recipe-->>TUI: ResumeRecipe (command, storage location)
  TUI-->>User: display resume recipe / select new session
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/self-update-preview-recipes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant