Problem
"List Rewrite Rules" returns only "Found 272 rewrite rules" with no actual rules shown.
Reported by @wpbullet in #56.
Root cause
The PHP backend has a show_details parameter that defaults to false. Without it, only rules_count and permalink_structure are returned — no actual rule patterns. The LLM never passes show_details: true because the system prompt only shows the tool description, not input parameters.
Verified via Ollama round-trip test:
- LLM sends:
{"action": "tool_call", "tool": "wp-agentic-admin/rewrite-list", "args": {}}
- PHP returns:
{ rules_count: 272, permalink_structure: "/%postname%/" } (no rules)
- LLM answers: "Found 272 rewrite rules with permalink structure /%postname%/."
Proposed fix
Remove the show_details flag and always return a useful sample of rules. With 272 rules and a 2000-char tool result truncation limit, returning all rules would overflow. Instead:
- Always include top ~20 rules grouped by pattern type (post, page, category, tag, feed, sitemap, etc.)
- Include a category summary — e.g., "45 post rules, 12 category rules, 8 feed rules..."
- Remove the
show_details parameter — it adds complexity the LLM can't use
// Always return a sample of rules grouped by type
$result['rule_sample'] = array_slice( $rules_array, 0, 20 );
$result['rule_categories'] = $categorized_counts; // e.g., ['post' => 45, 'page' => 12, ...]
Files to modify
includes/abilities/rewrite-list.php — remove show_details, always return sample + categories
Refs
Closes #56
Problem
"List Rewrite Rules" returns only "Found 272 rewrite rules" with no actual rules shown.
Reported by @wpbullet in #56.
Root cause
The PHP backend has a
show_detailsparameter that defaults tofalse. Without it, onlyrules_countandpermalink_structureare returned — no actual rule patterns. The LLM never passesshow_details: truebecause the system prompt only shows the tool description, not input parameters.Verified via Ollama round-trip test:
{"action": "tool_call", "tool": "wp-agentic-admin/rewrite-list", "args": {}}{ rules_count: 272, permalink_structure: "/%postname%/" }(no rules)Proposed fix
Remove the
show_detailsflag and always return a useful sample of rules. With 272 rules and a 2000-char tool result truncation limit, returning all rules would overflow. Instead:show_detailsparameter — it adds complexity the LLM can't useFiles to modify
includes/abilities/rewrite-list.php— removeshow_details, always return sample + categoriesRefs
Closes #56