Skip to content

fix: tighten agent-sdk package contents#1019

Merged
enyst merged 3 commits into
developfrom
codex/fix-agent-sdk-packaging
May 15, 2026
Merged

fix: tighten agent-sdk package contents#1019
enyst merged 3 commits into
developfrom
codex/fix-agent-sdk-packaging

Conversation

@smolpaws
Copy link
Copy Markdown
Collaborator

@smolpaws smolpaws commented May 15, 2026

Summary

  • stop emitting *.test.d.ts files into the published @smolpaws/agent-sdk package
  • add an SDK pack verification script that checks the packed version and rejects shipped test declarations
  • hook that verification into prepublishOnly so publish-time package regressions fail early

Verification

  • npm run pack:verify -w @smolpaws/agent-sdk
  • npm test -w @smolpaws/agent-sdk
  • npm test
  • npm run typecheck
  • npm run lint
  • npm run build

Open in Devin Review

Summary by CodeRabbit

  • Chores
    • Improved ESLint configuration to better differentiate rules for test and source files.
    • Added package verification scripts to validate packed contents before publishing.
    • Updated TypeScript configuration to exclude test files from compilation.
    • Removed obsolete lint-disable comments and adjusted test scaffolding to satisfy lint rules.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

Warning

Rate limit exceeded

@enyst has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 42 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 62e0b11c-aaa5-4572-b5f1-f94328fcfad5

📥 Commits

Reviewing files that changed from the base of the PR and between 24c4398 and bf748bb.

📒 Files selected for processing (1)
  • packages/agent-sdk/package.json
📝 Walkthrough

Walkthrough

This PR establishes test file exclusion from builds and packages in the agent-sdk workspace. ESLint and TypeScript configuration now properly scope test patterns (.test.ts, .spec.ts, and __tests__/**). A new verification script prevents test declaration files from reaching published packages. Outdated ESLint suppressions in tests are removed.

Changes

Test File Exclusion and Publishing Safety

Layer / File(s) Summary
TypeScript and ESLint test file scoping
packages/agent-sdk/eslint.config.js, packages/agent-sdk/tsconfig.json
ESLint main override now ignores test files; tests-specific override targets them explicitly and configures @typescript-eslint/no-unused-vars and disables no-undef. TypeScript excludes src/**/*.test.ts and src/**/*.spec.ts from compilation.
Package publishing verification
packages/agent-sdk/package.json, packages/agent-sdk/scripts/verify-pack.mjs
New pack:verify script builds and runs scripts/verify-pack.mjs which validates npm pack --dry-run --json --ignore-scripts yields a single artifact with matching name/version and no .test.d.ts or .spec.d.ts entries; wired into package lifecycle scripts.
Remove outdated ESLint suppressions
packages/agent-sdk/src/sdk/conversation/Conversation.factory.test.ts, packages/agent-sdk/src/sdk/conversation/LocalConversation.secretStorage.test.ts, packages/agent-sdk/src/sdk/conversation/LocalConversation.test.ts, packages/agent-sdk/src/sdk/security/__tests__/analyzer.test.ts, packages/agent-sdk/src/tools/__tests__/zod-tool.test.ts
Deletes eslint-disable-next-line suppressions and renames unused parameters to underscore-prefixed names across multiple tests to comply with the new scoped test ESLint rules.

Sequence Diagram(s)

sequenceDiagram
  actor Developer
  participant package.json
  participant verifyPack as verify-pack.mjs
  participant npm as npm-pack

  Developer->>package.json: publish / pack
  package.json->>verifyPack: run pack:verify / prepack
  verifyPack->>verifyPack: npm run build
  verifyPack->>npm: npm pack --dry-run --json --ignore-scripts
  npm-->>verifyPack: pack JSON result
  verifyPack->>verifyPack: validate name/version and file list
  verifyPack->>verifyPack: reject *.test.d.ts / *.spec.d.ts entries
  verifyPack-->>package.json: success / fail
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • enyst/OpenHands-Tab#105: Adjusts ESLint/tsconfig glob patterns for test file scoping in agent-sdk-related packages.

Suggested labels

codex

Suggested reviewers

  • enyst

Poem

🐰 Test files tucked away with care,
No more squirreling in the pair,
ESLint rules now neatly scoped,
A safety gate before we're coped,
Pack verified—no tests will sneak! 📦✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: tighten agent-sdk package contents' accurately reflects the main objective of the PR: preventing test declaration files from being emitted into the published package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-agent-sdk-packaging

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

gemini-code-assist[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@github-actions
Copy link
Copy Markdown

🔧 VSCode Extension Built Successfully

• File: openhands-tab-0.9.4.vsix (548 KB)
• Download: https://github.com/enyst/OpenHands-Tab/actions/runs/25944781734

To install:

  1. Download the artifact from the run page above
  2. VS Code → Command Palette → "Extensions: Install from VSIX..."
  3. Select the downloaded .vsix

Built with Node 22. Commit baed53a.

@enyst enyst merged commit 82f0b59 into develop May 15, 2026
10 of 11 checks passed
@enyst enyst deleted the codex/fix-agent-sdk-packaging branch May 15, 2026 22:45
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