Skip to content

Conversation

kaseonedge
Copy link
Contributor

@kaseonedge kaseonedge commented Oct 4, 2025

Added highly visible RETRY CONFIGURATION section at the top of all CLI agent scripts.
This provides immediate visibility into iteration limits - a key operational metric.

Changes:

  • Added prominent banner showing MAX_RETRIES configuration
  • Displays configuration source (env var or default)
  • Positioned early in script output (right after environment setup)
  • Consistent formatting across all CLIs

Banner format:
════════════════════════════════════════════════════════════════
║ RETRY CONFIGURATION ║
════════════════════════════════════════════════════════════════
🔄 Maximum Iterations: 10
📍 Source: EXECUTION_MAX_RETRIES environment variable
════════════════════════════════════════════════════════════════

Updated CLIs:

  • Factory: Uses FACTORY_MAX_RETRIES (default: 10)
  • Codex: Uses CODEX_MAX_RETRIES (default: 5)
  • Cursor: Uses CURSOR_MAX_RETRIES (default: 5)
  • OpenCode: Uses OPENCODE_MAX_RETRIES (default: 10, supports unlimited with 0)
  • Claude (Rex/Cleo/Tess): Uses CLAUDE_MAX_RETRIES (default: 10)

All fall back to EXECUTION_MAX_RETRIES then to their respective defaults.

This makes it immediately clear how many iterations each agent will attempt,
which is critical for cost estimation and operational monitoring.


Note

Adds a prominent RETRY CONFIGURATION banner (with source and value) early in Factory and OpenCode agent scripts, standardizing iteration-limit visibility via env vars or defaults.

  • Agents/CLI:
    • Factory: Update code_factory_container-base.sh.hbs to print a high-visibility RETRY CONFIGURATION banner showing MAX_RETRIES and its source (env/default) near startup.
    • OpenCode: Update code_opencode_container-base.sh.hbs similarly to surface MAX_RETRIES and source early in output.
  • Helm Charts:
    • Refresh template checksums in templates/agent-templates-factory.yaml and templates/agent-templates-opencode.yaml to include new container script content.

Written by Cursor Bugbot for commit 6b4b598. This will update automatically on new commits. Configure here.

Added highly visible RETRY CONFIGURATION section at the top of all CLI agent scripts.
This provides immediate visibility into iteration limits - a key operational metric.

Changes:
- Added prominent banner showing MAX_RETRIES configuration
- Displays configuration source (env var or default)
- Positioned early in script output (right after environment setup)
- Consistent formatting across all CLIs

Banner format:
════════════════════════════════════════════════════════════════
║                    RETRY CONFIGURATION                        ║
════════════════════════════════════════════════════════════════
🔄 Maximum Iterations: 10
📍 Source: EXECUTION_MAX_RETRIES environment variable
════════════════════════════════════════════════════════════════

Updated CLIs:
- Factory: Uses FACTORY_MAX_RETRIES (default: 10)
- Codex: Uses CODEX_MAX_RETRIES (default: 5)
- Cursor: Uses CURSOR_MAX_RETRIES (default: 5)
- OpenCode: Uses OPENCODE_MAX_RETRIES (default: 10, supports unlimited with 0)
- Claude (Rex/Cleo/Tess): Uses CLAUDE_MAX_RETRIES (default: 10)

All fall back to EXECUTION_MAX_RETRIES then to their respective defaults.

This makes it immediately clear how many iterations each agent will attempt,
which is critical for cost estimation and operational monitoring.
Copy link

github-actions bot commented Oct 4, 2025

📋 GitOps Changes Summary

Modified Applications:

Modified Database Resources:

📝 Detailed Diff

5DLabs Automation and others added 6 commits October 4, 2025 03:25
Previous fix quoted the heredoc delimiter which caused bash syntax errors
because command substitution \$(cat <<EOF) cannot contain quoted heredocs.

Fixed by:
- Reverted to unquoted delimiter: <<TESS_EOF (instead of <<'TESS_EOF')
- Escaped all backticks in documentation: \` instead of \`
- This prevents command execution while maintaining valid bash syntax

The issue was that bash cannot parse quoted heredocs inside command substitutions.
Escaping backticks achieves the same goal (preventing execution) without syntax errors.
Escaped the remaining unescaped backticks in kubectl examples.
All backticks in the INITIAL_GUIDANCE heredoc are now escaped.
The else block at line 1860 had no indentation, causing it to close
the outer if statement at line 1757 instead of the nested if at line 1844.
This created a second else block at line 2067, which bash rejected.

Fixed by indenting line 1860 to match its corresponding if statement.
The if statement at line 1844 was never closed with a fi.
The else at line 1860 had its closing fi at line 2065, but that only
closed the nested if/elif/elif chain (lines 1952-2007).

Added fi at line 2066 to properly close the if at line 1844.

Structure:
- 1757: if GH_AVAILABLE
  - 1844: if CI_JSON empty
    - post no-CI review
  - 1860: else
    - 1952: if FAILED_CHECKS > 0
    - 1980: elif PENDING_CHECKS > 0
    - 2007: elif SUCCESS_CHECKS == TOTAL
    - 2040: else
    - 2065: fi (closes 1952)
  - 2066: fi (closes 1844)  ← THIS WAS MISSING
- 2068: else (GH not available)
- 2072: fi (closes 1757)
@kaseonedge kaseonedge merged commit 8bbb138 into fix/factory-play Oct 5, 2025
kaseonedge added a commit that referenced this pull request Oct 5, 2025
* chore(chart): regenerate agent templates ConfigMaps

* Fix/cleo-retry-and-tess-trigger (#936)

* feat(agents): add prominent retry configuration banner at script startup

Added highly visible RETRY CONFIGURATION section at the top of all CLI agent scripts.
This provides immediate visibility into iteration limits - a key operational metric.

Changes:
- Added prominent banner showing MAX_RETRIES configuration
- Displays configuration source (env var or default)
- Positioned early in script output (right after environment setup)
- Consistent formatting across all CLIs

Banner format:
════════════════════════════════════════════════════════════════
║                    RETRY CONFIGURATION                        ║
════════════════════════════════════════════════════════════════
🔄 Maximum Iterations: 10
📍 Source: EXECUTION_MAX_RETRIES environment variable
════════════════════════════════════════════════════════════════

Updated CLIs:
- Factory: Uses FACTORY_MAX_RETRIES (default: 10)
- Codex: Uses CODEX_MAX_RETRIES (default: 5)
- Cursor: Uses CURSOR_MAX_RETRIES (default: 5)
- OpenCode: Uses OPENCODE_MAX_RETRIES (default: 10, supports unlimited with 0)
- Claude (Rex/Cleo/Tess): Uses CLAUDE_MAX_RETRIES (default: 10)

All fall back to EXECUTION_MAX_RETRIES then to their respective defaults.

This makes it immediately clear how many iterations each agent will attempt,
which is critical for cost estimation and operational monitoring.

* chore(chart): regenerate agent templates ConfigMaps

* fix(tess): escape backticks in heredoc instead of quoting delimiter

Previous fix quoted the heredoc delimiter which caused bash syntax errors
because command substitution \$(cat <<EOF) cannot contain quoted heredocs.

Fixed by:
- Reverted to unquoted delimiter: <<TESS_EOF (instead of <<'TESS_EOF')
- Escaped all backticks in documentation: \` instead of \`
- This prevents command execution while maintaining valid bash syntax

The issue was that bash cannot parse quoted heredocs inside command substitutions.
Escaping backticks achieves the same goal (preventing execution) without syntax errors.

* fix(tess): escape remaining backticks in heredoc documentation

Escaped the remaining unescaped backticks in kubectl examples.
All backticks in the INITIAL_GUIDANCE heredoc are now escaped.

* fix(tess): fix if/else/fi indentation to resolve syntax error

The else block at line 1860 had no indentation, causing it to close
the outer if statement at line 1757 instead of the nested if at line 1844.
This created a second else block at line 2067, which bash rejected.

Fixed by indenting line 1860 to match its corresponding if statement.

* fix(tess): add missing fi to close if statement at line 1844

The if statement at line 1844 was never closed with a fi.
The else at line 1860 had its closing fi at line 2065, but that only
closed the nested if/elif/elif chain (lines 1952-2007).

Added fi at line 2066 to properly close the if at line 1844.

Structure:
- 1757: if GH_AVAILABLE
  - 1844: if CI_JSON empty
    - post no-CI review
  - 1860: else
    - 1952: if FAILED_CHECKS > 0
    - 1980: elif PENDING_CHECKS > 0
    - 2007: elif SUCCESS_CHECKS == TOTAL
    - 2040: else
    - 2065: fi (closes 1952)
  - 2066: fi (closes 1844)  ← THIS WAS MISSING
- 2068: else (GH not available)
- 2072: fi (closes 1757)

* chore(chart): regenerate agent templates ConfigMaps

---------

Co-authored-by: MCP Server <mcp-server@5dlabs.com>
Co-authored-by: 5DLabs Automation <automation@5dlabs.ai>

---------

Co-authored-by: 5DLabs Automation <automation@5dlabs.ai>
Co-authored-by: MCP Server <mcp-server@5dlabs.com>
kaseonedge added a commit that referenced this pull request Oct 5, 2025
…#939)

* chore(chart): regenerate agent templates ConfigMaps

* feat(agents): add prominent retry configuration banner at script startup

Added highly visible RETRY CONFIGURATION section at the top of all CLI agent scripts.
This provides immediate visibility into iteration limits - a key operational metric.

Changes:
- Added prominent banner showing MAX_RETRIES configuration
- Displays configuration source (env var or default)
- Positioned early in script output (right after environment setup)
- Consistent formatting across all CLIs

Banner format:
════════════════════════════════════════════════════════════════
║                    RETRY CONFIGURATION                        ║
════════════════════════════════════════════════════════════════
🔄 Maximum Iterations: 10
📍 Source: EXECUTION_MAX_RETRIES environment variable
════════════════════════════════════════════════════════════════

Updated CLIs:
- Factory: Uses FACTORY_MAX_RETRIES (default: 10)
- Codex: Uses CODEX_MAX_RETRIES (default: 5)
- Cursor: Uses CURSOR_MAX_RETRIES (default: 5)
- OpenCode: Uses OPENCODE_MAX_RETRIES (default: 10, supports unlimited with 0)
- Claude (Rex/Cleo/Tess): Uses CLAUDE_MAX_RETRIES (default: 10)

All fall back to EXECUTION_MAX_RETRIES then to their respective defaults.

This makes it immediately clear how many iterations each agent will attempt,
which is critical for cost estimation and operational monitoring.

* chore(chart): regenerate agent templates ConfigMaps

* fix(tess): escape backticks in heredoc instead of quoting delimiter

Previous fix quoted the heredoc delimiter which caused bash syntax errors
because command substitution \$(cat <<EOF) cannot contain quoted heredocs.

Fixed by:
- Reverted to unquoted delimiter: <<TESS_EOF (instead of <<'TESS_EOF')
- Escaped all backticks in documentation: \` instead of \`
- This prevents command execution while maintaining valid bash syntax

The issue was that bash cannot parse quoted heredocs inside command substitutions.
Escaping backticks achieves the same goal (preventing execution) without syntax errors.

* fix(tess): escape remaining backticks in heredoc documentation

Escaped the remaining unescaped backticks in kubectl examples.
All backticks in the INITIAL_GUIDANCE heredoc are now escaped.

* fix(tess): fix if/else/fi indentation to resolve syntax error

The else block at line 1860 had no indentation, causing it to close
the outer if statement at line 1757 instead of the nested if at line 1844.
This created a second else block at line 2067, which bash rejected.

Fixed by indenting line 1860 to match its corresponding if statement.

* fix(tess): add missing fi to close if statement at line 1844

The if statement at line 1844 was never closed with a fi.
The else at line 1860 had its closing fi at line 2065, but that only
closed the nested if/elif/elif chain (lines 1952-2007).

Added fi at line 2066 to properly close the if at line 1844.

Structure:
- 1757: if GH_AVAILABLE
  - 1844: if CI_JSON empty
    - post no-CI review
  - 1860: else
    - 1952: if FAILED_CHECKS > 0
    - 1980: elif PENDING_CHECKS > 0
    - 2007: elif SUCCESS_CHECKS == TOTAL
    - 2040: else
    - 2065: fi (closes 1952)
  - 2066: fi (closes 1844)  ← THIS WAS MISSING
- 2068: else (GH not available)
- 2072: fi (closes 1757)

* chore(chart): regenerate agent templates ConfigMaps

* Fix/cleo-retry-and-tess-trigger (#936)

* feat(agents): add prominent retry configuration banner at script startup

Added highly visible RETRY CONFIGURATION section at the top of all CLI agent scripts.
This provides immediate visibility into iteration limits - a key operational metric.

Changes:
- Added prominent banner showing MAX_RETRIES configuration
- Displays configuration source (env var or default)
- Positioned early in script output (right after environment setup)
- Consistent formatting across all CLIs

Banner format:
════════════════════════════════════════════════════════════════
║                    RETRY CONFIGURATION                        ║
════════════════════════════════════════════════════════════════
🔄 Maximum Iterations: 10
📍 Source: EXECUTION_MAX_RETRIES environment variable
════════════════════════════════════════════════════════════════

Updated CLIs:
- Factory: Uses FACTORY_MAX_RETRIES (default: 10)
- Codex: Uses CODEX_MAX_RETRIES (default: 5)
- Cursor: Uses CURSOR_MAX_RETRIES (default: 5)
- OpenCode: Uses OPENCODE_MAX_RETRIES (default: 10, supports unlimited with 0)
- Claude (Rex/Cleo/Tess): Uses CLAUDE_MAX_RETRIES (default: 10)

All fall back to EXECUTION_MAX_RETRIES then to their respective defaults.

This makes it immediately clear how many iterations each agent will attempt,
which is critical for cost estimation and operational monitoring.

* chore(chart): regenerate agent templates ConfigMaps

* fix(tess): escape backticks in heredoc instead of quoting delimiter

Previous fix quoted the heredoc delimiter which caused bash syntax errors
because command substitution \$(cat <<EOF) cannot contain quoted heredocs.

Fixed by:
- Reverted to unquoted delimiter: <<TESS_EOF (instead of <<'TESS_EOF')
- Escaped all backticks in documentation: \` instead of \`
- This prevents command execution while maintaining valid bash syntax

The issue was that bash cannot parse quoted heredocs inside command substitutions.
Escaping backticks achieves the same goal (preventing execution) without syntax errors.

* fix(tess): escape remaining backticks in heredoc documentation

Escaped the remaining unescaped backticks in kubectl examples.
All backticks in the INITIAL_GUIDANCE heredoc are now escaped.

* fix(tess): fix if/else/fi indentation to resolve syntax error

The else block at line 1860 had no indentation, causing it to close
the outer if statement at line 1757 instead of the nested if at line 1844.
This created a second else block at line 2067, which bash rejected.

Fixed by indenting line 1860 to match its corresponding if statement.

* fix(tess): add missing fi to close if statement at line 1844

The if statement at line 1844 was never closed with a fi.
The else at line 1860 had its closing fi at line 2065, but that only
closed the nested if/elif/elif chain (lines 1952-2007).

Added fi at line 2066 to properly close the if at line 1844.

Structure:
- 1757: if GH_AVAILABLE
  - 1844: if CI_JSON empty
    - post no-CI review
  - 1860: else
    - 1952: if FAILED_CHECKS > 0
    - 1980: elif PENDING_CHECKS > 0
    - 2007: elif SUCCESS_CHECKS == TOTAL
    - 2040: else
    - 2065: fi (closes 1952)
  - 2066: fi (closes 1844)  ← THIS WAS MISSING
- 2068: else (GH not available)
- 2072: fi (closes 1757)

* chore(chart): regenerate agent templates ConfigMaps

---------

Co-authored-by: MCP Server <mcp-server@5dlabs.com>
Co-authored-by: 5DLabs Automation <automation@5dlabs.ai>

* chore: update agent templates ConfigMaps

- Regenerated from agent-templates/ source files
- Includes latest container script validation changes
- Ensures ArgoCD deploys current templates

* fix: remove service name defaulting that creates nested directories

Root cause: Early defaulting to service name prevented proper working
directory logic from using repository root when working_directory is empty.

Changes:
- Remove WORK_DIR defaulting to {{service}}
- Remove unused TARGET_DIR creation that made nested folders
- Let correct logic at line ~592 handle empty working_directory

Affects: Factory, Codex, Cursor, OpenCode CLIs

---------

Co-authored-by: 5DLabs Automation <automation@5dlabs.ai>
Co-authored-by: MCP Server <mcp-server@5dlabs.com>
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.

1 participant