Skip to content

[Feature] 支持自定义 Agent 会话恢复命令与附加参数 #323

Open

Description

@Cec1c

Problem / pain point — 现在的痛点

我通常使用 codex --yolo 启动会话。完全退出并重启 Pebrel 后,希望自动接续会话时也能使用自己指定的启动参数。

目前 Pebrel 会保存 Agent 的会话身份,恢复时为 Codex 构造固定的 codex resume <session_id>。虽然可以开关自动接续,但没有找到自定义这条恢复命令或附加参数的设置。这样就无法在 Pebrel 内明确配置恢复时继续使用 --yolo,多个 Agent 面板一起恢复时尤其不方便。

已核对 2026-09-27 的 main(ccd9b502):

这里提出的是恢复命令的可配置性需求。恢复后的实际权限仍取决于 Codex 自身配置和恢复逻辑,不将其描述为已经确认的权限回归。

Proposed solution — 希望的做法

希望允许按 Agent 配置会话恢复时的附加参数,或者提供自定义恢复命令模板。

以 Codex 为例,我希望能配置成:

codex resume {session_id} --yolo
  • Pebrel 自动将 {session_id} 替换为对应面板保存的会话 ID,并沿用恢复出的工作目录。
  • 未配置时继续使用现有默认恢复命令;--yolo 仅作为用户主动配置的示例。
  • 最小实现可以先支持每种 Agent 的“恢复附加参数”;如果支持完整命令模板,也可用于自定义可执行文件或包装脚本。
  • 配置应作用于重启后的自动接续,无需每次恢复后再手动重新运行命令。

重点是提供显式的恢复配置入口,不需要重放整个 Shell 命令历史。

Alternatives considered — 现在的替代办法

  • 手动执行 codex resume <session_id> --yolo,但每次重启后需要逐个处理面板。
  • 使用 Shell 函数、包装脚本或修改 Codex 全局配置可以作为替代思路,但会把配置分散到 Pebrel 之外,作用范围也可能超出会话恢复这一步。
  • Pebrel 已有的 Shell/Profile command、args 配置控制终端启动,不能直接配置随后根据保存的 Agent 会话 ID 生成的恢复命令。

已查看相关需求:#198 关注 Shell/WSL 启动参数,#160 关注恢复后显示历史命令;本需求关注 Agent 会话恢复命令与参数。

Platform / 平台

Windows

Related area / 相关范围

Tabs / splits / session restore / window size — 标签页、分屏、会话恢复、窗口尺寸, AI agent (Claude Code / Codex / Pi / OMP) — AI Agent 集成与状态

How important is this to you? / 对你有多重要

Would improve my daily workflow / 每天都会用到

Before submitting / 提交前确认

  • I searched existing issues for similar requests / 已搜索,无重复

Activity

  1. added
    area: agentsClaude Code / Codex / Pi / OMP 等 agent 集成与状态
    area: session会话恢复、标签页、工作区、窗口尺寸与位置
    os: windows仅 Windows 或与 ConPTY/Win32 相关
    on Sep 27, 2026
  2. WilliamWang1721 commented on Oct 3, 2026

    @WilliamWang1721
    Contributor

    Implementation is available in PR #457 (#457).

    Adds per-agent automatic-resume parameters with shell quoting, explicit empty arguments and retry-path coverage.

    Current upstream checks at 7b400440: failed: Native tests (macos-26-intel), Tests (ubuntu-24.04), Tests (windows-2022), Tests (macos-26), Tests (windows-11-arm), Tests (macos-26-intel), Release workspace (macos-26), Release workspace (macos-26-intel). passed: architecture-contracts, pr-size, lint, Native tests (ubuntu-24.04), Native tests (windows-2022), Native tests (macos-26), Native tests (windows-11-arm). The Intel macOS failure is in an unchanged baseline Unix-socket test; the hook crate is identical to main. Hosted macOS UI verification passed for this head; the screenshots were reviewed. Maintainer/Code Owner approval and any platform acceptance limitations described in the PR remain outstanding. This update does not close the issue.

  3. Kuddev commented on Nov 12, 2026

    @Kuddev
    Owner

    先支持每个 Agent 的恢复附加参数,能解决重启后逐个重跑的问题。未配置时沿用原恢复命令;会话 ID 与工作目录仍取各窗格保存的值。完整命令模板可以留到确有包装脚本需求时再评估。

    目前有 #457 和 #965。前者需同步主线并补跑检查;后者还有参数进入通知、旧恢复占用新会话的问题待修。2.5.5 尚未包含这项设置,本 Issue 保留。

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: agentsClaude Code / Codex / Pi / OMP 等 agent 集成与状态area: session会话恢复、标签页、工作区、窗口尺寸与位置os: windows仅 Windows 或与 ConPTY/Win32 相关

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions