Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

fix(release): recover version PR updates from Tegami's boxed errors (#185)

Leo8a945471c094
diff --git a/scripts/update-version-pull-request.test.ts b/scripts/update-version-pull-request.test.ts
index 88bfe3716..36062c679 100644
--- a/scripts/update-version-pull-request.test.ts
+++ b/scripts/update-version-pull-request.test.ts
@@ -36,6 +36,21 @@ describe("version pull request automation", () => {
'Plugin "github:version-request" failed:\nA pull request already exists',
),
).toBe(true);
+ // Tegami's boxed CLI output wraps the message across bordered lines.
+ expect(
+ isRecoverableVersionRequestFailure(
+ [
+ "◇ Error ──────────────────────────────╮",
+ "│ │",
+ '│ Plugin "github:version-request" failed during applyCliDraft: │',
+ '│ Failed to create the version pull request: {"message":"Validation │',
+ '│ Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A │',
+ "│ pull request already exists for │",
+ "│ opencoredev:tegami/version-packages. │",
+ "├──────────────────────────────────────╯",
+ ].join("\n"),
+ ),
+ ).toBe(true);
expect(
isRecoverableVersionRequestFailure(
'Plugin "github:version-request" failed: GitHub Actions is not permitted to create or approve pull requests',
diff --git a/scripts/update-version-pull-request.ts b/scripts/update-version-pull-request.ts
index 38e7c5bdb..d2aba8ad8 100644
--- a/scripts/update-version-pull-request.ts
+++ b/scripts/update-version-pull-request.ts
@@ -87,7 +87,9 @@ export function renderVersionPullRequestBody(
}
export function isRecoverableVersionRequestFailure(output: string): boolean {
- const normalized = output.replace(/\s+/gu, " ");
+ // Tegami wraps errors in a box whose border characters split words across
+ // lines, so strip the decoration before collapsing whitespace.
+ const normalized = output.replace(/[│├┤╮╯╭╰─◇└┌]/gu, " ").replace(/\s+/gu, " ");
return (
normalized.includes('Plugin "github:version-request" failed') &&
(normalized.includes("A pull request already exists") ||