Skip to content

GH#988: docs: improve AGENTS.md guidance for 4 recurring contributor error patterns#989

Merged
superdav42 merged 1 commit intomainfrom
feature/auto-20260429-111537-gh988
Apr 29, 2026
Merged

GH#988: docs: improve AGENTS.md guidance for 4 recurring contributor error patterns#989
superdav42 merged 1 commit intomainfrom
feature/auto-20260429-111537-gh988

Conversation

@superdav42
Copy link
Copy Markdown
Collaborator

@superdav42 superdav42 commented Apr 29, 2026

Summary

Addresses 4 recurring tool failure patterns observed in contributor superdav42's sessions, by improving the agent guidance section of AGENTS.md.

Pattern Count Fix applied
bash:other 77x Document phpcbf non-standard exit code 1 (successful auto-fix = exit 1, not error)
edit:not_read_first 46x Add prominent blockquote warning: session restart resets ALL read state
webfetch:other 39x Replace vague prose with explicit bullet list of failing domains
read:file_not_found 38x Expand non-existent paths table with 6 additional commonly-attempted paths

Files Modified

  • EDIT: AGENTS.md — 30 lines added to Quick Session Checklist, Read Before Edit, No External URL Fetching, and Common bash:other Failures sections

Verification

Changes are documentation-only (AGENTS.md). No code modified, no tests required. The content was derived directly from the 4 error patterns reported in the issue body.

Resolves #988


aidevops.sh v3.13.10 plugin for OpenCode v1.3.17 with claude-sonnet-4-6 spent 1m and 3,194 tokens on this as a headless worker.

Summary by CodeRabbit

  • Documentation
    • Enhanced agent instructions with expanded path lookup guidance for repository-specific file locations and configuration checks.
    • Clarified documentation categories and limitations for web fetch operations.
    • Added explicit notes on session behavior and tool-specific requirements for file handling.

…erns (GH#988)

Address 4 recurring error patterns observed in contributor sessions:
- bash:other (77x): document phpcbf exit code 1 behavior on successful auto-fixes
- edit:not_read_first (46x): add prominent session-restart read-state warning
- webfetch:other (39x): make the list of failing URL domains explicit and specific
- read:file_not_found (38x): expand the non-existent paths table with 7 more entries

Ref #988
@superdav42 superdav42 added the origin:worker Auto-created by pulse labelless backfill (t2112) label Apr 29, 2026
@github-actions
Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 29, 2026

📝 Walkthrough

Walkthrough

This PR updates AGENTS.md documentation to address recurring agent failure patterns, including expanded path existence checks, clarified webfetch restrictions, documented session state behavior, and detailed phpcbf exit codes with post-fix file reading requirements.

Changes

Cohort / File(s) Summary
Agent Instruction Updates
AGENTS.md
Expanded path lookup table with repo-specific file locations; rewrote webfetch prohibition section with exact documentation categories; documented session restart behavior; added phpcbf exit code guidance and file re-read requirement after auto-fixes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 Hops of wisdom, paths made clear,
Webfetch shunned, session restart near,
Files re-read before each twist,
Exit codes no longer missed! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically references issue GH#988 and summarizes the main change: improving AGENTS.md guidance for 4 recurring contributor error patterns.
Linked Issues check ✅ Passed The PR directly addresses all four error patterns from issue #988: documents phpcbf exit codes for bash:other, warns about session restart resetting read state for edit:not_read_first, lists failing domains for webfetch:other, and expands the non-existent paths table for read:file_not_found.
Out of Scope Changes check ✅ Passed All changes are scoped to AGENTS.md documentation improvements directly addressing the four error patterns identified in issue #988; no code or test changes are included.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/auto-20260429-111537-gh988

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@github-actions
Copy link
Copy Markdown

Performance Test Results

Performance test results for f76e458 are in 🛎️!

Note: the numbers in parentheses show the difference to the previous (baseline) test run. Differences below 2% or 0.5 in absolute values are not shown.

URL: /

Run DB Queries Memory Before Template Template WP Total LCP TTFB LCP - TTFB
0 40 37.73 MB 809.50 ms (-42.00 ms / -5% ) 167.50 ms (-15.50 ms / -9% ) 1080.00 ms 2042.00 ms 1950.80 ms 97.00 ms (+2.10 ms / +2% )
1 56 49.03 MB 989.50 ms (+42.00 ms / +4% ) 158.00 ms (+7.50 ms / +5% ) 1145.00 ms (+45.50 ms / +4% ) 2160.00 ms (+76.00 ms / +4% ) 2074.75 ms (+73.85 ms / +4% ) 84.45 ms

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@AGENTS.md`:
- Around line 519-522: Replace the suggested "vendor/bin/phpcbf ... || true"
pattern because it masks real failures; instead update the docs to run
"vendor/bin/phpcbf inc/path/to/file.php", capture its exit status, and
explicitly fail only when the status is greater than 1 (printing an error and
exiting with that status) while allowing 0 (clean) and 1 (fixes applied) to
proceed; specifically remove the "|| true" recommendation and show using the
phpcbf command, storing "$?" and checking if status > 1 to echo a failure
message and exit with that code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d9fc6c9c-c8c1-46d7-aeed-151e5b3c6ef2

📥 Commits

Reviewing files that changed from the base of the PR and between ad905f9 and 94320e9.

📒 Files selected for processing (1)
  • AGENTS.md

Comment thread AGENTS.md
Comment on lines +519 to +522
```bash
vendor/bin/phpcbf inc/path/to/file.php # exits 1 even when it fixed everything (false failure)
vendor/bin/phpcbf inc/path/to/file.php || true # correct — ignore expected exit code 1
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

What are the official PHPCBF exit codes (0, 1, 2+) and their meanings in PHP_CodeSniffer documentation?

💡 Result:

The official PHPCBF exit codes, as documented in the PHP_CodeSniffer (PHPCSStandards) wiki "Advanced Usage" page (current as of PHP_CodeSniffer 4.0.0+), are bit-wise cumulative flags with the following base meanings (applicable to phpcbf): - 0: clean code base / auto-fixed with no issues remaining / successful non-scan request - 1: issues found/remaining, auto-fixable - 2: issues found/remaining, non-auto-fixable - 4: failure to fix some files/fixer conflict (phpcbf only) - 16: processing error - blocking the actual run of PHP_CodeSniffer (e.g., parse error in XML ruleset) - 64: requirements for running not met (e.g., PHP version or missing extensions) Common combinations include: - 3 (1+2): mix of auto-fixable and non-auto-fixable issues (phpcs only, but relevant context) - 5 (1+4): auto-fixable issues, but some failed to fix (phpcbf only) - 7 (1+2+4): mix, with some failed to fix (phpcbf only) Exit codes can be modified via config flags like ignore_errors_on_exit, ignore_warnings_on_exit, ignore_non_auto_fixable_on_exit. For legacy PHP_CodeSniffer 3.x: - 0: no fixable errors found, nothing fixed - 1: all fixable errors fixed correctly - 2: failed to fix some fixable errors - 3: processing error Since today is 2026-04-29, version 4+ semantics apply (revision implemented by May 2025 per issues).

Citations:


Do not recommend phpcbf ... || true — it masks real failures.

|| true suppresses all non-zero exit codes, including genuine failures (codes 2+, 16, 64), which can hide broken runs in CI or scripts. The doc should show a pattern that accepts only expected codes (0 for clean/fixed, 1 for remaining auto-fixable issues) and fails on any actual error:

vendor/bin/phpcbf inc/path/to/file.php
status=$?
if [ "$status" -gt 1 ]; then
  echo "phpcbf failed with exit code $status"
  exit "$status"
fi
# status 0 = nothing to fix, status 1 = fixes applied
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` around lines 519 - 522, Replace the suggested "vendor/bin/phpcbf
... || true" pattern because it masks real failures; instead update the docs to
run "vendor/bin/phpcbf inc/path/to/file.php", capture its exit status, and
explicitly fail only when the status is greater than 1 (printing an error and
exiting with that status) while allowing 0 (clean) and 1 (fixes applied) to
proceed; specifically remove the "|| true" recommendation and show using the
phpcbf command, storing "$?" and checking if status > 1 to echo a failure
message and exit with that code.

@superdav42 superdav42 merged commit 3e0d3e5 into main Apr 29, 2026
11 checks passed
@superdav42
Copy link
Copy Markdown
Collaborator Author

Summary

Addresses 4 recurring tool failure patterns observed in contributor superdav42's sessions, by improving the agent guidance section of AGENTS.md.

Pattern Count Fix applied
bash:other 77x Document phpcbf non-standard exit code 1 (successful auto-fix = exit 1, not error)
edit:not_read_first 46x Add prominent blockquote warning: session restart resets ALL read state
webfetch:other 39x Replace vague prose with explicit bullet list of failing domains
read:file_not_found 38x Expand non-existent paths table with 6 additional commonly-attempted paths

Files Modified

  • EDIT: AGENTS.md — 30 lines added to Quick Session Checklist, Read Before Edit, No External URL Fetching, and Common bash:other Failures sections

Verification

Changes are documentation-only (AGENTS.md). No code modified, no tests required. The content was derived directly from the 4 error patterns reported in the issue body.


aidevops.sh v3.13.10 plugin for OpenCode v1.3.17 with claude-sonnet-4-6 spent 1m and 3,194 tokens on this as a headless worker.


Merged via PR #989 to main.
Merged by deterministic merge pass (pulse-wrapper.sh).

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

Labels

origin:worker Auto-created by pulse labelless backfill (t2112)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contributor insight: 4 recurring error pattern(s) from superdav42

1 participant