Skip to content

enh: skills#5

Open
echarles wants to merge 5 commits intomainfrom
enh/skills
Open

enh: skills#5
echarles wants to merge 5 commits intomainfrom
enh/skills

Conversation

@echarles
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 16, 2026 17:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes the default sandbox variant naming to "eval" across the codebase and improves CLI usability for the GitHub skill scripts by providing clearer guidance when invalid arguments are supplied.

Changes:

  • Rename/standardize sandbox variant references from "local-eval" to "eval" (config default, tests, examples, docs, README, executor comments).
  • Add a custom ArgumentParser subclass to GitHub skill scripts to show more helpful usage/parameter guidance on invalid args.
  • Configure pytest to discover tests from the tests/ directory via testpaths.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_executor_async.py Updates sandbox creation to use variant="eval".
tests/test_direct_execution.py Updates CodeModeConfig.sandbox_variant to "eval".
tests/test_agent_minimal.py Updates CodeModeConfig.sandbox_variant to "eval".
skills/github/scripts/search_repos.py Adds custom argparse error handler with parameter guidance.
skills/github/scripts/list_repos.py Adds custom argparse error handler with parameter guidance.
skills/github/scripts/list_prs.py Adds custom argparse error handler with parameter guidance.
skills/github/scripts/list_issues.py Adds custom argparse error handler with parameter guidance.
skills/github/scripts/get_repo.py Adds custom argparse error handler with parameter guidance.
pyproject.toml Sets pytest testpaths to ["tests"].
examples/simple/agent_cli.py Updates LocalEvalSandbox import path.
examples/patterns/codemode_example.py Updates sandbox_variant example to "eval".
docs/docs/skills/index.mdx Updates LocalEvalSandbox import path in docs snippet.
agent_codemode/types.py Changes default sandbox_variant to "eval".
agent_codemode/composition/executor.py Updates terminology in comments/docstrings from local-eval to eval.
README.md Updates documented default sandbox_variant to "eval".
Comments suppressed due to low confidence (1)

agent_codemode/composition/executor.py:140

  • This method name (_is_local_eval_sandbox) and local variable (is_local_eval) still refer to “local_eval”, but the updated docstring/comments now call the same concept “eval”. This makes the branching logic harder to follow; consider renaming the method/variable (or updating the docstring) for consistency. Also, the docstring should use “an eval type”, not “a eval type”.
    def _is_local_eval_sandbox(self) -> bool:
        """Check if the sandbox is a eval type (has in-memory namespaces).
        
        This checks the actual sandbox instance, not the config, to handle
        cases where an external sandbox is passed that differs from config.
        """

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +123 to +133
params_help = (
"\nValid parameters for list_repos:\n"
" --visibility all | public | private (default: all)\n"
" --sort updated | created | pushed | full_name (default: updated)\n"
" --format table | json (default: table)\n"
" --limit integer — max repos to return\n"
"\nDo NOT pass 'per_page' — use 'limit' instead.\n"
)
self.print_usage(sys.stderr)
print(f"\nerror: {message}", file=sys.stderr)
print(params_help, file=sys.stderr)
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring says this parser “prints full help on invalid arguments”, but error() prints usage plus a custom parameters block rather than argparse’s full help text. Consider calling self.print_help(sys.stderr) (or adjusting the docstring) to keep behavior and documentation aligned.

Suggested change
params_help = (
"\nValid parameters for list_repos:\n"
" --visibility all | public | private (default: all)\n"
" --sort updated | created | pushed | full_name (default: updated)\n"
" --format table | json (default: table)\n"
" --limit integer — max repos to return\n"
"\nDo NOT pass 'per_page' — use 'limit' instead.\n"
)
self.print_usage(sys.stderr)
print(f"\nerror: {message}", file=sys.stderr)
print(params_help, file=sys.stderr)
print(f"\nerror: {message}", file=sys.stderr)
print("", file=sys.stderr)
self.print_help(sys.stderr)

Copilot uses AI. Check for mistakes.


class _HelpOnErrorParser(argparse.ArgumentParser):
"""ArgumentParser that prints full help on invalid arguments."""
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class docstring says this parser “prints full help on invalid arguments”, but error() only prints usage + a custom parameter summary. To avoid misleading users, either print the full argparse help (self.print_help(sys.stderr)) or update the docstring/wording accordingly.

Suggested change
"""ArgumentParser that prints full help on invalid arguments."""
"""ArgumentParser that prints usage and a parameter summary on invalid arguments."""

Copilot uses AI. Check for mistakes.


class _HelpOnErrorParser(argparse.ArgumentParser):
"""ArgumentParser that prints full help on invalid arguments."""
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring claims “prints full help on invalid arguments”, but error() prints usage plus a hand-written parameter list. Either include self.print_help(sys.stderr) to truly show full help, or adjust the docstring to reflect what’s printed.

Suggested change
"""ArgumentParser that prints full help on invalid arguments."""
"""ArgumentParser that prints usage and parameter guidance on invalid arguments."""

Copilot uses AI. Check for mistakes.


class _HelpOnErrorParser(argparse.ArgumentParser):
"""ArgumentParser that prints full help on invalid arguments."""
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring says this parser prints “full help” on errors, but error() prints usage and a custom parameter summary rather than argparse’s full help output. Consider printing self.print_help(sys.stderr) (or rewording the docstring) so expectations match behavior.

Suggested change
"""ArgumentParser that prints full help on invalid arguments."""
"""ArgumentParser that prints usage and a concise parameter summary on invalid arguments."""

Copilot uses AI. Check for mistakes.
Comment on lines +128 to +132
class _HelpOnErrorParser(argparse.ArgumentParser):
"""ArgumentParser that prints full help on invalid arguments."""

def error(self, message: str) -> None: # noqa: D401
params_help = (
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring says this parser “prints full help on invalid arguments”, but error() only prints usage plus a custom parameters block. Either call self.print_help(sys.stderr)/self.format_help() (and optionally append the custom notes), or reword the docstring to match the actual behavior so it’s not misleading.

Copilot uses AI. Check for mistakes.
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