SDK is missing .app.agent and still has the old .app.modes #1167

Closed
opened 2026-02-16 17:29:50 -05:00 by yindo · 3 comments
Owner

Originally created by @ndraiman on GitHub (Aug 8, 2025).

I have updated to @opencode-ai/sdk 0.4.1 and its still has the old modes function instead of the new agent added in https://github.com/sst/opencode/pull/1689

Image

SDK version:

❯ bun why @opencode-ai/sdk
@opencode-ai/sdk@0.4.1
└─ server@workspace (requires ^0.4.1)

Error:

Property 'agent' does not exist on type 'App'. Did you mean 'get'?ts(2551)

Currently working around it using fetch 🙂

Originally created by @ndraiman on GitHub (Aug 8, 2025). I have updated to `@opencode-ai/sdk` `0.4.1` and its still has the old `modes` function instead of the new `agent` added in https://github.com/sst/opencode/pull/1689 <img width="397" height="78" alt="Image" src="https://github.com/user-attachments/assets/9f654fdc-12a2-4e80-b12a-136f2c01f96b" /> SDK version: > ❯ bun why @opencode-ai/sdk @opencode-ai/sdk@0.4.1 └─ server@workspace (requires ^0.4.1) Error: > Property 'agent' does not exist on type 'App'. Did you mean 'get'?ts(2551) Currently working around it using `fetch` 🙂
yindo closed this issue 2026-02-16 17:29:50 -05:00
Author
Owner

@rekram1-node commented on GitHub (Aug 8, 2025):

@ndraiman

Are you sure you didn't just need to restart your ts language server? I have 0.4.1 installed and client.app.agents() works, see type:

declare class App extends _HeyApiClient {
    /**
     * Get app info
     */
    get<ThrowOnError extends boolean = false>(options?: Options<AppGetData, ThrowOnError>): import("./client").RequestResult<AppGetResponses, unknown, ThrowOnError, "fields">;
    /**
     * Initialize the app
     */
    init<ThrowOnError extends boolean = false>(options?: Options<AppInitData, ThrowOnError>): import("./client").RequestResult<AppInitResponses, unknown, ThrowOnError, "fields">;
    /**
     * Write a log entry to the server logs
     */
    log<ThrowOnError extends boolean = false>(options?: Options<AppLogData, ThrowOnError>): import("./client").RequestResult<AppLogResponses, unknown, ThrowOnError, "fields">;
    /**
     * List all agents
     */
    agents<ThrowOnError extends boolean = false>(options?: Options<AppAgentsData, ThrowOnError>): import("./client").RequestResult<AppAgentsResponses, unknown, ThrowOnError, "fields">;
}
@rekram1-node commented on GitHub (Aug 8, 2025): @ndraiman Are you sure you didn't just need to restart your ts language server? I have 0.4.1 installed and client.app.agents() works, see type: ```ts declare class App extends _HeyApiClient { /** * Get app info */ get<ThrowOnError extends boolean = false>(options?: Options<AppGetData, ThrowOnError>): import("./client").RequestResult<AppGetResponses, unknown, ThrowOnError, "fields">; /** * Initialize the app */ init<ThrowOnError extends boolean = false>(options?: Options<AppInitData, ThrowOnError>): import("./client").RequestResult<AppInitResponses, unknown, ThrowOnError, "fields">; /** * Write a log entry to the server logs */ log<ThrowOnError extends boolean = false>(options?: Options<AppLogData, ThrowOnError>): import("./client").RequestResult<AppLogResponses, unknown, ThrowOnError, "fields">; /** * List all agents */ agents<ThrowOnError extends boolean = false>(options?: Options<AppAgentsData, ThrowOnError>): import("./client").RequestResult<AppAgentsResponses, unknown, ThrowOnError, "fields">; } ```
Author
Owner

@ndraiman commented on GitHub (Aug 8, 2025):

@ndraiman

Are you sure you didn't just need to restart your ts language server? I have 0.4.1 installed and client.app.agents() works, see type:

declare class App extends _HeyApiClient {
    /**
     * Get app info
     */
    get<ThrowOnError extends boolean = false>(options?: Options<AppGetData, ThrowOnError>): import("./client").RequestResult<AppGetResponses, unknown, ThrowOnError, "fields">;
    /**
     * Initialize the app
     */
    init<ThrowOnError extends boolean = false>(options?: Options<AppInitData, ThrowOnError>): import("./client").RequestResult<AppInitResponses, unknown, ThrowOnError, "fields">;
    /**
     * Write a log entry to the server logs
     */
    log<ThrowOnError extends boolean = false>(options?: Options<AppLogData, ThrowOnError>): import("./client").RequestResult<AppLogResponses, unknown, ThrowOnError, "fields">;
    /**
     * List all agents
     */
    agents<ThrowOnError extends boolean = false>(options?: Options<AppAgentsData, ThrowOnError>): import("./client").RequestResult<AppAgentsResponses, unknown, ThrowOnError, "fields">;
}

I CMD-clicked into the same file and saw mode and no agents, but I'll re-check, thank you.

@ndraiman commented on GitHub (Aug 8, 2025): > @ndraiman > > Are you sure you didn't just need to restart your ts language server? I have 0.4.1 installed and client.app.agents() works, see type: > ```ts > declare class App extends _HeyApiClient { > /** > * Get app info > */ > get<ThrowOnError extends boolean = false>(options?: Options<AppGetData, ThrowOnError>): import("./client").RequestResult<AppGetResponses, unknown, ThrowOnError, "fields">; > /** > * Initialize the app > */ > init<ThrowOnError extends boolean = false>(options?: Options<AppInitData, ThrowOnError>): import("./client").RequestResult<AppInitResponses, unknown, ThrowOnError, "fields">; > /** > * Write a log entry to the server logs > */ > log<ThrowOnError extends boolean = false>(options?: Options<AppLogData, ThrowOnError>): import("./client").RequestResult<AppLogResponses, unknown, ThrowOnError, "fields">; > /** > * List all agents > */ > agents<ThrowOnError extends boolean = false>(options?: Options<AppAgentsData, ThrowOnError>): import("./client").RequestResult<AppAgentsResponses, unknown, ThrowOnError, "fields">; > } > ``` I CMD-clicked into the same file and saw mode and no agents, but I'll re-check, thank you.
Author
Owner

@ndraiman commented on GitHub (Aug 8, 2025):

Deleting node_modules solved it.

@ndraiman commented on GitHub (Aug 8, 2025): Deleting `node_modules` solved it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1167