Skip to content

fix: set GIT_PAGER=cat to prevent git pager CPU spin (fixes #1697)#1709

Open
RemyLoveLogicAI wants to merge 33 commits into
agent0ai:readyfrom
RemyLoveLogicAI:main
Open

fix: set GIT_PAGER=cat to prevent git pager CPU spin (fixes #1697)#1709
RemyLoveLogicAI wants to merge 33 commits into
agent0ai:readyfrom
RemyLoveLogicAI:main

Conversation

@RemyLoveLogicAI

Copy link
Copy Markdown

Summary

When Agent Zero's code_execution_tool runs git commands that produce long output (e.g., git diff, git branch -a, git log), git pipes the output through the default pager (more or less). In the non-interactive terminal sessions created by code_execution_tool, the pager waits for user input (space/q) that never comes. The pager then spins at 100% CPU per process indefinitely, consuming cores until the container is restarted.

Fix

In plugins/_code_execution/helpers/shell_local.py, the connect() method now passes GIT_PAGER=cat and PAGER=cat in the environment variables to the TTYSession constructor. This tells git to skip the interactive pager and output directly to stdout.

Changes

  • Added import os to shell_local.py
  • In connect(): copy the current environment and set GIT_PAGER=cat and PAGER=cat before passing to TTYSession

Fixes #1697

LoveLogic AI Dev and others added 29 commits August 8, 2025 07:53
…systems-for-revenue-generation

Add viral video experiment instrument
The following vulnerabilities are fixed by pinning transitive dependencies:
- https://snyk.io/vuln/SNYK-PYTHON-PYPDF-14105065

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

https://github.com/agent0ai/agent-zero/blob/cc982cb1d3292ab26ea9b16f40120802f28c13e4/plugins/_code_execution/helpers/shell_local.py#L1
P1 Badge Set the pager in python.helpers.shell_local

This adds an empty helper under plugins/_code_execution, but code_execution_tool imports LocalInteractiveSession from python.helpers.shell_local (python/tools/code_execution_tool.py:8), and repo-wide search finds no imports of this new path. Because the real python/helpers/shell_local.py still starts bash without GIT_PAGER=cat or PAGER=cat, git commands run through local code_execution_tool sessions still hit the default pager and the CPU-spin issue remains unresolved.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/hacking.md

## Custom Prompts

The hacking image sets `AGENT_PROMPTS_SUBDIR=hacking`, enabling prompts from `prompts/hacking/` to override defaults. You can modify these files to suit your workflow.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Wire the hacking image to the hacking prompts

This states that the hacking image sets AGENT_PROMPTS_SUBDIR=hacking, but the Kali Dockerfile and /exe/run_A0.sh do not set that environment variable or pass --agent_prompts_subdir=hacking, and the settings code defaults agent_prompts_subdir to default. As a result, users who run the documented frdel/agent-zero-run:hacking image still get the default prompt set unless they manually change settings, so the added prompts/hacking/ override is not enabled by the image as documented.

Useful? React with 👍 / 👎.

@RemyLoveLogicAI

Copy link
Copy Markdown
Author

Working on resolving merge conflicts now.

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