Skip to content

Commit b332389

Browse files
committed
Give documentation runs enough agent turns
1 parent aa13789 commit b332389

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/maintain-docs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ env:
6969
description: Validate the prepared Docs Agent task without starting a live agent run.
7070
type: boolean
7171
default: false
72+
max_turns:
73+
description: Maximum agent turns available for repository discovery, documentation writes, and final diff inspection.
74+
type: number
75+
default: 32
7276
secrets:
7377
OPENAI_API_KEY:
7478
description: Optional OpenAI credential used for live Docs Agent runs.
@@ -364,6 +368,7 @@ jobs:
364368
artifact_declarations: ${{ needs.prepare.outputs.artifact_declarations }}
365369
output_projections: ${{ needs.prepare.outputs.output_projections }}
366370
callback_data: ${{ needs.prepare.outputs.recipe_json }}
371+
max_turns: ${{ inputs.max_turns }}
367372
run_agent: ${{ inputs.run_agent }}
368373
dry_run: ${{ inputs.dry_run }}
369374
secrets:

tests/validate-docs-agent-packages.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@
9898
$assert( str_contains( $maintain_docs_workflow, 'ACCESS_TOKEN: ${{ github.token }}' ), 'maintain-docs.yml must forward the caller-scoped GitHub token to the native runner.' );
9999
$assert( str_contains( $maintain_docs_workflow, 'EXTERNAL_PACKAGE_SOURCE_POLICY: ${{ secrets.EXTERNAL_PACKAGE_SOURCE_POLICY }}' ), 'maintain-docs.yml must explicitly forward the external package source policy.' );
100100
$assert( str_contains( $maintain_docs_workflow, 'runtime_sources: ${{ needs.prepare.outputs.runtime_sources }}' ), 'maintain-docs.yml must pass its complete native runtime closure to WP Codebox.' );
101+
$assert( str_contains( $maintain_docs_workflow, 'max_turns: ${{ inputs.max_turns }}' ), 'maintain-docs.yml must forward its documentation-sized turn budget to WP Codebox.' );
102+
$assert( 1 === preg_match( '/max_turns:\s*\n\s+description:.*\n\s+type: number\s*\n\s+default: 32/', $maintain_docs_workflow ), 'maintain-docs.yml must default to enough turns for bootstrap discovery, writes, and diff inspection.' );
101103

102104
$workflow_readme = (string) file_get_contents( $root . '/.github/workflows/README.md' );
103105
foreach ( array( 'Docs Agent Runner Recipe', 'portable recipe', 'Docs Agent owns the native package' ) as $migration_note_text ) {

tests/validate-wp-codebox-run-agent-task-contract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
$input = $contract['inputs'][ $name ] ?? null;
157157
$assert( is_array( $input ), "Docs Agent passes producer input {$name}, which is absent from the producer schema." );
158158
$type = $input['type'] ?? null;
159-
$actual_type = preg_match( '/^(true|false)$/', $value ) === 1 || in_array( $name, array( 'success_requires_pr', 'run_agent', 'dry_run' ), true ) ? 'boolean' : ( is_numeric( $value ) ? 'number' : 'string' );
159+
$actual_type = preg_match( '/^(true|false)$/', $value ) === 1 || in_array( $name, array( 'success_requires_pr', 'run_agent', 'dry_run' ), true ) ? 'boolean' : ( is_numeric( $value ) || 'max_turns' === $name ? 'number' : 'string' );
160160
$assert( $type === $actual_type, "Docs Agent input {$name} has {$actual_type} shape; producer requires {$type}." );
161161
}
162162

0 commit comments

Comments
 (0)