Skip to content

fix(banner): PAI-OpenCode v3.0 branding — replace vanilla PAI 4.0.3 defaults#140

Closed
Steffen025 wants to merge 1 commit intodevfrom
fix/banner-pai-opencode-branding
Closed

fix(banner): PAI-OpenCode v3.0 branding — replace vanilla PAI 4.0.3 defaults#140
Steffen025 wants to merge 1 commit intodevfrom
fix/banner-pai-opencode-branding

Conversation

@Steffen025
Copy link
Copy Markdown
Owner

@Steffen025 Steffen025 commented Apr 13, 2026

Summary

When users type pai, the startup banner was showing vanilla PAI branding (v4.0.3, Daniel Miessler's repo URL) instead of PAI-OpenCode identifiers.

Changes (Banner.ts)

Before After
paiVersion = "4.0.3" (hardcoded default) paiVersion = "3.0.0"
repoUrl = "github.com/danielmiessler/PAI" repoUrl = "github.com/Steffen025/pai-opencode"
settings.pai?.version || "2.0" settings.pai?.version || "3.0.0"
Header: PAI | Personal AI Infrastructure Header: PAI-OpenCode v3.0.0 | Personal AI Infrastructure
No credit line Credit: Built on PAI by Daniel Miessler · github.com/danielmiessler/PAI
claude --version for version detection opencode --version

Result

  • Large + medium banners now show PAI-OpenCode v3.0.0 in the header
  • Footer URL points to this repo (github.com/Steffen025/pai-opencode)
  • Credit line gives proper attribution to Daniel Miessler and links to upstream PAI
  • Version detection no longer calls the non-existent claude binary

Summary by CodeRabbit

  • Updates
    • Updated banner branding to display "PAI-OpenCode" with dynamic version information.
    • Added attribution credit line to banner footer.
    • Refreshed version defaults and tool detection.

….0.3

- Default paiVersion: '4.0.3' → '3.0.0' (PAI-OpenCode version)
- Default repoUrl: 'github.com/danielmiessler/PAI' → 'github.com/Steffen025/pai-opencode'
- settings.json fallback version: '2.0' → '3.0.0'
- Header text: 'PAI | Personal AI Infrastructure'
  → 'PAI-OpenCode v3.0.0 | Personal AI Infrastructure' (large + medium banners)
- Credit line added below repo URL in large + medium banners:
  'Built on PAI by Daniel Miessler · github.com/danielmiessler/PAI'
- Version detection: 'claude --version' → 'opencode --version'
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

The Banner.ts file is updated to change the default PAI version from 4.0.3 to 3.0.0, update the repository URL to github.com/Steffen025/pai-opencode, switch version probing from claude --version to opencode --version, and revise banner display text with dynamic version information and new footer attribution lines.

Changes

Cohort / File(s) Summary
Banner Configuration & Display Updates
.opencode/PAI/Tools/Banner.ts
Updated default PAI version to 3.0.0, changed version probing command from claude to opencode, modified banner header to display PAI-OpenCode v${stats.paiVersion} dynamically, and revised footer content with new attribution line crediting Daniel Miessler and original PAI repository.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A banner bright, reborn anew
With OpenCode in vibrant view
Version numbers dance and gleam,
Credits flowing like a stream,
From Claude to opencode we hop—
A rabbit's touch, and changes pop! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: updating banner branding from vanilla PAI 4.0.3 defaults to PAI-OpenCode v3.0.0 identifiers, which is the core objective of this changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/banner-pai-opencode-branding

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.opencode/PAI/Tools/Banner.ts:
- Around line 705-708: The credit centering uses a hardcoded 61 width causing
off-by-2 alignment; update the centering logic in Banner.ts where creditLine and
creditPad are computed (variables creditLine, creditPad, and subsequent
lines.push calls) to use the correct visible length (change the hardcoded 61 to
63) or, better, compute the visible length dynamically by stripping ANSI/color
codes from creditLine and using that length when calculating "
".repeat(Math.max(0, Math.floor((width - visibleLen) / 2))); ensure the same
approach is applied where the Navy banner had the same fix.
- Around line 363-368: The center alignment is off because creditLen is
hardcoded as 61 while the visible text is 63; update the code around
creditLine/creditLen/creditPad to compute the visible length dynamically (e.g.,
define the plain text "Built on PAI by Daniel Miessler ·
github.com/danielmiessler/PAI" and set creditLen = visibleText.length) or simply
change creditLen to 63 so creditPad centers correctly before pushing the line
with lines.push(`${creditPad}${creditLine}`).
- Around line 683-686: The centering uses a hardcoded 44 width causing
misalignment; update the calculation in Banner.ts to use the correct visible
header length (48) by replacing the 44 in the headerPad computation (the line
that computes headerPad using " ".repeat(Math.max(0, Math.floor((width - 44) /
2)))) with 48 (or compute the actual headerText length dynamically) so
headerText is centered correctly; adjust the same constant wherever the Navy
banner used 48 to keep behavior consistent.
- Around line 328-333: The hardcoded headerLen (44) is incorrect for the visible
header length; instead compute the visible length dynamically by stripping
ANSI/color sequences from headerText (e.g., remove /\x1b\[[0-9;]*m/g) and use
that length to compute headerPad so centering uses the actual visible character
count; update the code around headerLen/headerPad/headerText (and keep usage of
stats.paiVersion, width, headerPad, lines.push) to calculate visibleLength =
headerTextWithoutColors.length and then set headerPad = "
".repeat(Math.floor((width - visibleLength) / 2)).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 01dac6c4-84ac-4f63-9bf1-40b8c2a368a6

📥 Commits

Reviewing files that changed from the base of the PR and between b772613 and aaedf78.

📒 Files selected for processing (1)
  • .opencode/PAI/Tools/Banner.ts

Comment on lines +328 to 333
// Header: PAI-OpenCode v3.0 | Personal AI Infrastructure
const paiColored = `${C.navy}P${RESET}${C.medBlue}A${RESET}${C.lightBlue}I${RESET}`;
const headerText = `${paiColored} ${C.steel}|${RESET} ${C.slate}Personal AI Infrastructure${RESET}`;
const headerLen = 33; // "PAI | Personal AI Infrastructure"
const headerText = `${paiColored}${C.slate}-OpenCode ${C.silver}v${stats.paiVersion}${RESET} ${C.steel}|${RESET} ${C.slate}Personal AI Infrastructure${RESET}`;
const headerLen = 44; // "PAI-OpenCode v3.0.0 | Personal AI Infrastructure"
const headerPad = " ".repeat(Math.floor((width - headerLen) / 2));
lines.push(`${headerPad}${headerText}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

headerLen calculation appears slightly off.

The visible length of "PAI-OpenCode v3.0.0 | Personal AI Infrastructure" is 48 characters, but headerLen is set to 44. This will cause the header to be slightly off-center (~2 characters to the right).

Note: The length varies with version string (e.g., v10.0.0 would be 49 chars). Consider computing dynamically or adjusting to 48 for typical version strings.

Suggested fix
-  const headerLen = 44; // "PAI-OpenCode v3.0.0 | Personal AI Infrastructure"
+  const headerLen = 48; // "PAI-OpenCode v3.0.0 | Personal AI Infrastructure"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Header: PAI-OpenCode v3.0 | Personal AI Infrastructure
const paiColored = `${C.navy}P${RESET}${C.medBlue}A${RESET}${C.lightBlue}I${RESET}`;
const headerText = `${paiColored} ${C.steel}|${RESET} ${C.slate}Personal AI Infrastructure${RESET}`;
const headerLen = 33; // "PAI | Personal AI Infrastructure"
const headerText = `${paiColored}${C.slate}-OpenCode ${C.silver}v${stats.paiVersion}${RESET} ${C.steel}|${RESET} ${C.slate}Personal AI Infrastructure${RESET}`;
const headerLen = 44; // "PAI-OpenCode v3.0.0 | Personal AI Infrastructure"
const headerPad = " ".repeat(Math.floor((width - headerLen) / 2));
lines.push(`${headerPad}${headerText}`);
// Header: PAI-OpenCode v3.0 | Personal AI Infrastructure
const paiColored = `${C.navy}P${RESET}${C.medBlue}A${RESET}${C.lightBlue}I${RESET}`;
const headerText = `${paiColored}${C.slate}-OpenCode ${C.silver}v${stats.paiVersion}${RESET} ${C.steel}|${RESET} ${C.slate}Personal AI Infrastructure${RESET}`;
const headerLen = 48; // "PAI-OpenCode v3.0.0 | Personal AI Infrastructure"
const headerPad = " ".repeat(Math.floor((width - headerLen) / 2));
lines.push(`${headerPad}${headerText}`);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.opencode/PAI/Tools/Banner.ts around lines 328 - 333, The hardcoded
headerLen (44) is incorrect for the visible header length; instead compute the
visible length dynamically by stripping ANSI/color sequences from headerText
(e.g., remove /\x1b\[[0-9;]*m/g) and use that length to compute headerPad so
centering uses the actual visible character count; update the code around
headerLen/headerPad/headerText (and keep usage of stats.paiVersion, width,
headerPad, lines.push) to calculate visibleLength =
headerTextWithoutColors.length and then set headerPad = "
".repeat(Math.floor((width - visibleLength) / 2)).

Comment on lines +363 to 368

const creditLine = `${C.muted}Built on PAI by Daniel Miessler \u00b7 github.com/danielmiessler/PAI${RESET}`;
const creditLen = 61; // visible length
const creditPad = " ".repeat(Math.floor((width - creditLen) / 2));
lines.push(`${creditPad}${creditLine}`);
lines.push("");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

creditLen calculation appears slightly off.

The visible length of "Built on PAI by Daniel Miessler · github.com/danielmiessler/PAI" is 63 characters, but creditLen is set to 61. This will cause slight off-center alignment.

Suggested fix
-  const creditLen = 61; // visible length
+  const creditLen = 63; // visible length
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const creditLine = `${C.muted}Built on PAI by Daniel Miessler \u00b7 github.com/danielmiessler/PAI${RESET}`;
const creditLen = 61; // visible length
const creditPad = " ".repeat(Math.floor((width - creditLen) / 2));
lines.push(`${creditPad}${creditLine}`);
lines.push("");
const creditLine = `${C.muted}Built on PAI by Daniel Miessler \u00b7 github.com/danielmiessler/PAI${RESET}`;
const creditLen = 63; // visible length
const creditPad = " ".repeat(Math.floor((width - creditLen) / 2));
lines.push(`${creditPad}${creditLine}`);
lines.push("");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.opencode/PAI/Tools/Banner.ts around lines 363 - 368, The center alignment
is off because creditLen is hardcoded as 61 while the visible text is 63; update
the code around creditLine/creditLen/creditPad to compute the visible length
dynamically (e.g., define the plain text "Built on PAI by Daniel Miessler ·
github.com/danielmiessler/PAI" and set creditLen = visibleText.length) or simply
change creditLen to 63 so creditPad centers correctly before pushing the line
with lines.push(`${creditPad}${creditLine}`).

Comment on lines +683 to 686
const headerText = `${paiColored}${C.slate}-OpenCode ${C.silver}v${stats.paiVersion}${RESET} ${C.steel}|${RESET} ${C.slate}Personal AI Infrastructure${RESET}`;
const headerPad = " ".repeat(Math.max(0, Math.floor((width - 44) / 2)));
lines.push(`${headerPad}${headerText}`);
lines.push("");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Same headerLen discrepancy as the Navy banner.

The header width used for centering (44) should be 48 to match the actual visible text length.

Suggested fix
-  const headerPad = " ".repeat(Math.max(0, Math.floor((width - 44) / 2)));
+  const headerPad = " ".repeat(Math.max(0, Math.floor((width - 48) / 2)));
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const headerText = `${paiColored}${C.slate}-OpenCode ${C.silver}v${stats.paiVersion}${RESET} ${C.steel}|${RESET} ${C.slate}Personal AI Infrastructure${RESET}`;
const headerPad = " ".repeat(Math.max(0, Math.floor((width - 44) / 2)));
lines.push(`${headerPad}${headerText}`);
lines.push("");
const headerText = `${paiColored}${C.slate}-OpenCode ${C.silver}v${stats.paiVersion}${RESET} ${C.steel}|${RESET} ${C.slate}Personal AI Infrastructure${RESET}`;
const headerPad = " ".repeat(Math.max(0, Math.floor((width - 48) / 2)));
lines.push(`${headerPad}${headerText}`);
lines.push("");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.opencode/PAI/Tools/Banner.ts around lines 683 - 686, The centering uses a
hardcoded 44 width causing misalignment; update the calculation in Banner.ts to
use the correct visible header length (48) by replacing the 44 in the headerPad
computation (the line that computes headerPad using " ".repeat(Math.max(0,
Math.floor((width - 44) / 2)))) with 48 (or compute the actual headerText length
dynamically) so headerText is centered correctly; adjust the same constant
wherever the Navy banner used 48 to keep behavior consistent.

Comment on lines +705 to 708
const creditLine = `${C.steel}Built on PAI by Daniel Miessler \u00b7 github.com/danielmiessler/PAI${RESET}`;
const creditPad = " ".repeat(Math.max(0, Math.floor((width - 61) / 2)));
lines.push(`${creditPad}${creditLine}`);
lines.push("");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Same creditLen discrepancy as the Navy banner.

The credit width used for centering (61) should be 63 to match the actual visible text length.

Suggested fix
-  const creditPad = " ".repeat(Math.max(0, Math.floor((width - 61) / 2)));
+  const creditPad = " ".repeat(Math.max(0, Math.floor((width - 63) / 2)));
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const creditLine = `${C.steel}Built on PAI by Daniel Miessler \u00b7 github.com/danielmiessler/PAI${RESET}`;
const creditPad = " ".repeat(Math.max(0, Math.floor((width - 61) / 2)));
lines.push(`${creditPad}${creditLine}`);
lines.push("");
const creditLine = `${C.steel}Built on PAI by Daniel Miessler \u00b7 github.com/danielmiessler/PAI${RESET}`;
const creditPad = " ".repeat(Math.max(0, Math.floor((width - 63) / 2)));
lines.push(`${creditPad}${creditLine}`);
lines.push("");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.opencode/PAI/Tools/Banner.ts around lines 705 - 708, The credit centering
uses a hardcoded 61 width causing off-by-2 alignment; update the centering logic
in Banner.ts where creditLine and creditPad are computed (variables creditLine,
creditPad, and subsequent lines.push calls) to use the correct visible length
(change the hardcoded 61 to 63) or, better, compute the visible length
dynamically by stripping ANSI/color codes from creditLine and using that length
when calculating " ".repeat(Math.max(0, Math.floor((width - visibleLen) / 2)));
ensure the same approach is applied where the Navy banner had the same fix.

@Steffen025
Copy link
Copy Markdown
Owner Author

Closing — change folded into release PR #139 as part of v3.0.

@Steffen025 Steffen025 closed this Apr 13, 2026
@Steffen025 Steffen025 deleted the fix/banner-pai-opencode-branding branch April 13, 2026 13:09
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