Skip to content

feat(execute): tip when mac-telnet runs with no credentials (JG-24)#47

Merged
mobileskyfi merged 2 commits into
mainfrom
feat/mac-telnet-no-auth-tip-jg24
Jun 16, 2026
Merged

feat(execute): tip when mac-telnet runs with no credentials (JG-24)#47
mobileskyfi merged 2 commits into
mainfrom
feat/mac-telnet-no-auth-tip-jg24

Conversation

@mobileskyfi

Copy link
Copy Markdown
Contributor

What

When execute resolves to mac-telnet with no username or password from any source, the envelope now carries a tip/mac-telnet-no-credentials pointer. mac-telnet logs in with RouterOS credentials over MTWEI (MD5 is refused by current RouterOS), so an empty login is rejected only at connect time — this surfaces it up front. It's a tip, not an error (the constitution's "no username set" advice channel); the call is still attempted.

The two halves of JG-24

  1. "don't invert the auth default" — already correct + guarded: offerMtwei defaults to true (MTWEI offered first, MD5 only as fallback) and test/unit/mac-telnet.test.ts exercises the default. No change needed.
  2. "add a tip when no auth options given" — the new bit, implemented here.

How

  • resolvedExecuteTips(resolved) fires the tip when via === "mac-telnet" and no username and no password were resolved (the true "no auth options" case — a username-only or password-present resolution does not fire). Wired into both the success and resolved-error envelope builders (previously hard-coded tips: []).
  • DRY: promoted the tip() builder + TIPS_BASE_URL from devices.ts to core/envelope.ts (buildTip, alongside the Tip type); devices.ts now imports it. No behavior change to the existing device tips.

Tests / verification

  • test/unit/execute.test.ts — hermetic fire/no-fire matrix (mac-telnet+no-creds fires; password, username-only, and IP transports do not; details URL + MTWEI mention checked).
  • Existing device-tip tests still green on the shared buildTip.
  • bun run lint ✅ · bun run lint:ci ✅ · bun run test (704 pass) ✅ · bun run build

Additive advisory metadata — the mac-telnet run path is unchanged, so no CHR run is required. MATRIX unchanged.

🤖 Generated with Claude Code

mac-telnet logs in with RouterOS credentials over MTWEI (MD5 is refused by
current RouterOS), so an empty login is rejected only at connect time. execute
now surfaces that up front: when the resolved transport is mac-telnet and no
username/password is resolved from any source, the envelope carries a
`tip/mac-telnet-no-credentials` pointer (advice, not an error — the call is still
attempted), on both the success and resolved-error paths.

The MTWEI-vs-MD5 auth default is already correct and guarded (`offerMtwei`
defaults true; `test/unit/mac-telnet.test.ts`), so JG-24's "don't invert the auth
default" half needs no change — only the missing tip.

Promotes the `tip()` builder + `TIPS_BASE_URL` from devices.ts to
`core/envelope.ts` (`buildTip`, where the `Tip` type lives) so execute and
devices share one definition. Hermetic unit tests pin the fire/no-fire matrix
(mac-telnet + no creds fires; password, username-only, or an IP transport do not).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 16, 2026 16:05
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@mobileskyfi, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 23 minutes and 22 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5ff5e861-31c1-45a1-8833-afa7c5b80435

📥 Commits

Reviewing files that changed from the base of the PR and between 091692d and 0915c7c.

📒 Files selected for processing (5)
  • commands/execute/README.md
  • src/core/envelope.ts
  • src/devices.ts
  • src/execute.ts
  • test/unit/execute.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/mac-telnet-no-auth-tip-jg24

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds an advisory “tips” signal to the execute result envelope when a resolved mac-telnet run has no resolved username and no resolved password, and centralizes tip construction so tip URLs are generated consistently across commands.

Changes:

  • Add resolvedExecuteTips() and wire it into both execute success and error envelopes.
  • Promote the tip builder + base URL into src/core/envelope.ts and reuse it from devices.
  • Add unit tests for the mac-telnet no-credentials tip logic and document the new tip in commands/execute/README.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/unit/execute.test.ts Adds hermetic tests for the new mac-telnet “no credentials” tip logic.
src/execute.ts Computes and attaches execute tips based on the resolved request (mac-telnet + no creds).
src/devices.ts Switches existing device tips to use the shared buildTip() helper.
src/core/envelope.ts Introduces TIPS_BASE_URL and buildTip() for consistent tip URL generation.
commands/execute/README.md Documents when and why tip/mac-telnet-no-credentials is emitted.

Comment thread test/unit/execute.test.ts Outdated
Comment on lines +184 to +188
expect(tips.map((t) => t.code)).toContain("tip/mac-telnet-no-credentials");
expect(tips[0]?.detailsUrl).toContain(
"/tips/tip/mac-telnet-no-credentials",
);
expect(tips[0]?.fix).toContain("MTWEI");
)

Copilot review: asserting `tips[0]` is brittle if `resolvedExecuteTips` ever
returns more than one tip. Find the tip by code before checking its fields.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mobileskyfi mobileskyfi merged commit 70c0341 into main Jun 16, 2026
9 checks passed
@mobileskyfi mobileskyfi deleted the feat/mac-telnet-no-auth-tip-jg24 branch June 16, 2026 16:23
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.

2 participants