* Build a context string for push_repo_memory job failures, with a dedicated section for patch size errors. * @param {boolean} hasPushRepoMemoryFailure - Whether the push_repo_memory job failed * @param {string[]} repoMemoryPatchSizeExceededIDs - Memory IDs that exceeded the patch size limit * @p
(hasPushRepoMemoryFailure, repoMemoryPatchSizeExceededIDs, runUrl)
| 996 | * @returns {string} Formatted context string, or empty string if no failure |
| 997 | */ |
| 998 | function buildPushRepoMemoryFailureContext(hasPushRepoMemoryFailure, repoMemoryPatchSizeExceededIDs, runUrl) { |
| 999 | if (!hasPushRepoMemoryFailure) { |
| 1000 | return ""; |
| 1001 | } |
| 1002 | if (repoMemoryPatchSizeExceededIDs.length > 0) { |
| 1003 | let context = "\n**📦 Repo-Memory Patch Size Exceeded**: The repo-memory push failed because the memory data is too large.\n"; |
| 1004 | context += "\n**Affected memories:** " + repoMemoryPatchSizeExceededIDs.map(id => `\`${id}\``).join(", ") + "\n"; |
| 1005 | context += "\nTo allow larger memory snapshots, increase `max-patch-size` in your workflow's `repo-memory` front matter (value in bytes):\n"; |
| 1006 | context += "```yaml\nrepo-memory:\n"; |
| 1007 | for (const memoryID of repoMemoryPatchSizeExceededIDs) { |
| 1008 | context += ` - id: ${memoryID}\n max-patch-size: 51200 # Example: 5x the default limit (in bytes, default: 10240, max: 102400)\n`; |
| 1009 | } |
| 1010 | context += "```\n\n"; |
| 1011 | return context; |
| 1012 | } |
| 1013 | return ( |
| 1014 | buildWarningAlertLine( |
| 1015 | "Repo-Memory Push Failed", |
| 1016 | "The push-repo-memory job failed to write memory back to the repository. This may indicate a permission issue, a configuration error, or a network problem. Check the [workflow run](" + runUrl + ") for details." |
| 1017 | ) + "\n" |
| 1018 | ); |
| 1019 | } |
| 1020 | |
| 1021 | /** |
| 1022 | * Load missing_data messages from agent output |
no test coverage detected