Skip to content

fix(server-hono): type HonoServerProvider.app field as OpenAPIHonoType instead of any#1343

Open
Goutham-Annem wants to merge 1 commit into
VoltAgent:mainfrom
Goutham-Annem:fix/server-hono-reduce-any-types
Open

fix(server-hono): type HonoServerProvider.app field as OpenAPIHonoType instead of any#1343
Goutham-Annem wants to merge 1 commit into
VoltAgent:mainfrom
Goutham-Annem:fix/server-hono-reduce-any-types

Conversation

@Goutham-Annem

@Goutham-Annem Goutham-Annem commented Jun 15, 2026

Copy link
Copy Markdown

What is current behavior?

HonoServerProvider.app is typed as any, losing type safety:

private app?: any; // Store app instance to extract custom endpoints

What is new behavior?

The field is typed as OpenAPIHonoType, which is exactly the type returned by createApp and already accepted by extractCustomEndpoints:

private app?: OpenAPIHonoType;

This removes the any from the stored app reference without requiring any cast, since both the assignment (this.app = app from createApp) and the consumption (extractCustomEndpoints(this.app)) already use OpenAPIHonoType.

Notes for reviewers

  • extractCustomEndpoints(app: OpenAPIHonoType) already uses this type — no change needed there.
  • No behavior change, purely a type improvement.

Summary by cubic

Change HonoServerProvider.app type from any to OpenAPIHonoType to match createApp and extractCustomEndpoints. Improves type safety and IDE autocomplete with no runtime changes.

Written for commit e94a82d. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved type safety for the Hono server application instance, replacing a generic type with a more specific type definition.

@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e94a82d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@voltagent/server-hono Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d6487d1e-c378-414d-abda-555287d7ae7c

📥 Commits

Reviewing files that changed from the base of the PR and between 1e1af65 and e94a82d.

📒 Files selected for processing (2)
  • .changeset/server-hono-type-app-field.md
  • packages/server-hono/src/hono-server-provider.ts

📝 Walkthrough

Walkthrough

HonoServerProvider in packages/server-hono replaces the any type on its private app field with the imported OpenAPIHonoType. No runtime logic changes. A patch changeset entry is added for @voltagent/server-hono.

Changes

Type fix for HonoServerProvider.app

Layer / File(s) Summary
Narrow app field type and changeset
packages/server-hono/src/hono-server-provider.ts, .changeset/server-hono-type-app-field.md
Imports OpenAPIHonoType and changes private app?: any to private app?: OpenAPIHonoType; adds the corresponding patch changeset entry.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A bunny hopped in, sniffed the code with care,
"That any type is hiding something there!"
🐇 With one swift paw swap, OpenAPIHonoType in place,
The field now wears a proper, typed embrace.
No runtime changed — just clarity to share! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly summarizes the main change: typing HonoServerProvider.app as OpenAPIHonoType instead of any, which matches the changeset and code modifications.
Description check ✅ Passed The description includes what is the current behavior, what is the new behavior, notes for reviewers, and explains the type safety improvement without requiring casts.
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

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

No issues found across 2 files

Re-trigger cubic

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