Skip to content

Conversation

@Braden-sui
Copy link

Summary

  • Add foundational vibe-utils module with shared utilities for vibe functionality
  • HTTP fetch with timeout, retry logic, and exponential backoff
  • URL validation and security checks
  • Verbose logging utilities
  • Full test coverage (58 tests)

PR 1 of 5 - Vibe Command Implementation

This is the first in a series of PRs implementing the --vibe CLI command:

  1. vibe-utils (this PR) - Foundation utilities
  2. vibe-auth - Authentication with PKCE
  3. vibe-files + vibe-prompt - File handling and prompt construction
  4. jiron-discovery + vibe-generate + vibe-publish - API discovery, generation, publishing
  5. vibe-core + CLI integration - Orchestration layer

Test plan

  • All 58 vibe-utils tests pass
  • Module exports properly via package.json

🤖 Generated with Claude Code

Add foundational utility module for vibe functionality:
- HTTP fetch with timeout and retry logic
- Exponential backoff for transient failures
- URL validation and security checks
- Verbose logging utilities
- Error handling with error-causes

This is the first module in the vibe command implementation,
providing shared functionality for authentication, file handling,
code generation, and publishing modules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95b83c835e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 354 to 356
const response = await fetch(url, {
...init,
signal: controller.signal,

Choose a reason for hiding this comment

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

P2 Badge Respect caller AbortSignal when adding timeouts

Because the timeout wrapper always sets signal: controller.signal after spreading init, any init.signal provided by callers is overwritten. That means external cancellation (e.g., user aborting an in‑flight request) is ignored and the request will continue until the timeout fires, which can hang CLI flows that rely on early aborts or misclassify a user‑initiated abort as a timeout. This shows up whenever a caller passes an AbortSignal to fetchWithTimeout or fetchWithRetry expecting it to cancel the request.

Useful? React with 👍 / 👎.

Comment on lines 861 to 866
// Reject absolute paths (check both original and normalized)
if (
filePath.startsWith("/") ||
normalizedPath.startsWith("/") ||
/^[A-Za-z]:/.test(filePath) ||
/^[A-Za-z]:/.test(normalizedPath)

Choose a reason for hiding this comment

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

P2 Badge Block UNC absolute paths in isPathSafe

The absolute‑path check only rejects Unix roots and drive‑letter prefixes, so UNC paths like \\server\share\file are treated as relative and pass validation. On Windows (or any environment that resolves UNC paths as absolute), this allows callers to supply a path that escapes the working directory while still returning { safe: true }, undermining the security intent of the traversal guard.

Useful? React with 👍 / 👎.

@Braden-sui
Copy link
Author

@cursor review

@cursor
Copy link

cursor bot commented Jan 8, 2026

Skipping Bugbot: Bugbot is disabled for this repository

Two security fixes for vibe-utils:

1. fetchWithTimeout - AbortSignal combination (P2)
   - Previously overwrote caller-provided signals with timeout signal
   - Now uses AbortSignal.any() to combine timeout and external signals
   - External cancellation (user abort) is now properly respected
   - Distinguishes timeout aborts from external aborts in error handling

2. isPathSafe - UNC path detection (P2)
   - Previously only checked for Unix and Windows drive letter absolute paths
   - UNC paths like \server\share bypassed validation
   - Now detects UNC paths (\\) as absolute paths and rejects them

Both fixes include comprehensive test coverage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Braden-sui
Copy link
Author

@codex

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.

Extends absolute path detection to catch single-backslash root-relative
paths like \Windows\System32 which resolve to the current drive's root
on Windows.

Previous check only caught:
  - Unix absolute: /etc/passwd
  - Drive letter: C:\Windows
  - UNC paths: \server\share

Now also catches:
  - Root-relative: \Windows\System32
  - Any path starting with backslash

TDD approach: tests written first (RED), then implementation (GREEN).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ericelliott
Copy link
Collaborator

@cursoragent please review

@ericelliott
Copy link
Collaborator

@cursor please review

@Braden-sui Braden-sui closed this by deleting the head repository Jan 16, 2026
@ericelliott
Copy link
Collaborator

Hi Braden - why'd you close this? I was hoping to review this stuff with you and get it merged. Can you book another meeting with me to discuss? I'm excited to move this partnership forward.

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