Skip to content

feat(session): allow per-agent extra args on native resume - #2105

Closed
Chibionos wants to merge 1 commit into
herdrdev:masterfrom
Chibionos:feat/session-resume-extra-args
Closed

feat(session): allow per-agent extra args on native resume#2105
Chibionos wants to merge 1 commit into
herdrdev:masterfrom
Chibionos:feat/session-resume-extra-args

Conversation

@Chibionos

Copy link
Copy Markdown

Summary

Adds [session.resume_extra_args] so native agent session restore can inject per-agent CLI flags after the executable (e.g. Claude bypass-permissions, Codex --yolo).

Discussion (required for feature direction): #2104

Per CONTRIBUTING this is a behavior/feature change; maintainers may need to grant a scope override for non-fix: PRs. Draft until aligned.

Example

[session.resume_extra_args]
claude = ["--dangerously-skip-permissions"]
codex = ["--yolo"]

Becomes on restore:

  • claude --dangerously-skip-permissions --resume <id>
  • codex --yolo resume <id>

Changes

  • Config: SessionConfig.resume_extra_args with validation (canonical agent ids, arg length/count/control-char checks)
  • Resume planner: plan_with_extra_args inserts args after argv[0]
  • Restore path threads the map through; handoff included
  • Next-release docs + config reference + default-config comments
  • Unit tests for parse, planner insertion, and restore plan application

Out of scope

  • In-app Settings UI for freeform arg lists (config.toml only)
  • Default args for herdr agent start (separate from restore)

Test plan

  • cargo test extra_args / restore_plan / resume_agents related unit tests
  • python3 scripts/config_reference_check.py
  • cargo fmt --check
  • Manual: enable extra args, stop/start herdr server with a Claude/Codex session ref, confirm resumed process line includes flags

Native restore hardcodes argv like `claude --resume <id>` and
`codex resume <id>`, so YOLO / bypass-permissions flags are lost on
server restart. Add `[session.resume_extra_args]` so users can inject
global CLI flags after the executable (e.g. claude +
--dangerously-skip-permissions, codex + --yolo).
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ai-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 320dabfc-eafe-4258-a6f0-12bdd51e9aa6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@kangal-bot

Copy link
Copy Markdown
Collaborator

Hi @Chibionos, thanks for your interest in contributing!

Herdr automatically admits focused bug fixes from contributors who are not maintainers when the title uses fix: ... or fix(scope): ... and the patch changes no more than 20 files and 1,000 total added or deleted lines.

Contributors who are not maintainers may submit only focused bug fixes. If this pull request fixes a bug, rename it to use a conventional fix: ... or fix(scope): ... title, then tag a maintainer to review and reopen it.

Feature requests, behavior changes, and other proposals belong in GitHub Discussions and require maintainer approval before a pull request.

If this gate classified the pull request incorrectly, reply and tag a maintainer listed in .github/MAINTAINERS. A verified maintainer can reopen it; reopening by anyone else will be closed again automatically.

Patch size: 8 changed files, 278 changed lines.

See https://github.com/herdrdev/herdr/blob/master/CONTRIBUTING.md for the contribution policy.

@kangal-bot kangal-bot closed this Jul 30, 2026
@Chibionos

Copy link
Copy Markdown
Author

Thanks @kangal-bot — expected close under the non-maintainer feature gate.

This is a feature/behavior change, not a bug fix, so it stays as a Discussion first per CONTRIBUTING:

@ogulcancelik if you approve the discussion direction, please reopen this PR (or open a maintainer PR from the branch) with a scope override. I will not reopen it myself.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants