Skip to content

When AI edit a file it strips all generics in TS #21911

@ouwargui

Description

@ouwargui

Description

Every time AI edits a file, if there's any generic tags it strips without me asking. And if I ask to add it back it can't, it keeps trying to edit but nothing happens. It happens with all models, I think it is related to the edit tool.

This started after I removed oh-my-opencode, I tried doing a clean re-install, but it didn't work.

Here's a few examples:

diff

- <DashboardSectionWithSheet<ProductShowcaseRecord & { _id: string }>
+ <DashboardSectionWithSheet
- export const getStaticProps: GetStaticProps<ExplorePageProps> = async () => {
+ export const getStaticProps: GetStaticProps = async () => {
- return result as ObjectTypeParser<SqlFeaturedBusiness, Date, string>;
+ return result as ObjectTypeParser;

asking it to re-insert my generics

Image

Plugins

only built-ins

OpenCode version

1.4.3

Steps to reproduce

  1. Ask it to make changes to a TS file with generics
  2. Watch it strip all your generic without you asking for it

Screenshot and/or share link

https://opncd.ai/share/2db8Z5yU

Operating System

macOS 26.3.1

Terminal

Ghostty

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions