Skip to content

Commit e583e5b

Browse files
committed
fix: promptHandle.resolve() always uses API when client is available, removing task-context-only gate
1 parent 4f396c7 commit e583e5b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/trigger-sdk/src/v3/prompt.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
apiClientManager,
44
resourceCatalog,
55
SemanticInternalAttributes,
6-
taskContext,
76
type PromptMetadataWithFunctions,
87
type TaskSchema,
98
type inferSchemaIn,
@@ -154,11 +153,10 @@ export function definePrompt<TVariables extends TaskSchema | undefined = undefin
154153
: variables;
155154
const vars = validated as Record<string, unknown>;
156155

157-
const ctx = taskContext.ctx;
158156
const apiClient = apiClientManager.client;
159157

160-
// If we're running inside a task on the platform, resolve via the API
161-
if (ctx && apiClient) {
158+
// Resolve via the API when a client is configured (inside tasks or via configure())
159+
if (apiClient) {
162160
const response = await apiClient.resolvePrompt(
163161
options.id,
164162
{

0 commit comments

Comments
 (0)