Prototype: add Shopify CLI agent conversation context#7460
Draft
Prototype: add Shopify CLI agent conversation context#7460
Conversation
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationspackages/cli-kit/dist/public/node/agent.d.tsexport declare const SHOPIFY_CLI_AGENT_CONTEXT = "SHOPIFY_CLI_AGENT_CONTEXT";
export declare const SHOPIFY_CLI_AGENT = "SHOPIFY_CLI_AGENT";
export declare const SHOPIFY_CLI_AGENT_VERSION = "SHOPIFY_CLI_AGENT_VERSION";
export declare const SHOPIFY_CLI_AGENT_PROVIDER = "SHOPIFY_CLI_AGENT_PROVIDER";
export declare const SHOPIFY_CLI_AGENT_MODEL = "SHOPIFY_CLI_AGENT_MODEL";
export declare const SHOPIFY_CLI_AGENT_HARNESS = "SHOPIFY_CLI_AGENT_HARNESS";
export declare const SHOPIFY_CLI_AGENT_RUN_ID = "SHOPIFY_CLI_AGENT_RUN_ID";
export declare const SHOPIFY_CLI_AGENT_SESSION_ID = "SHOPIFY_CLI_AGENT_SESSION_ID";
export interface AgentConversationContext {
conversationId: string;
agent?: string;
agentVersion?: string;
provider?: string;
harness?: string;
model?: string;
startedAt: string;
}
export interface AgentConversationHandle extends AgentConversationContext {
contextPath: string;
}
export interface StartAgentConversationInput {
conversationId?: string;
agent?: string;
agentVersion?: string;
provider?: string;
harness?: string;
model?: string;
startedAt?: string;
}
export declare function generateConversationId(): string;
export declare function createAgentConversationContext(input?: StartAgentConversationInput): AgentConversationContext;
export declare function startAgentConversation(input?: StartAgentConversationInput): Promise<AgentConversationHandle>;
export declare function inspectAgentConversation(options?: {
contextPath?: string;
env?: NodeJS.ProcessEnv;
}): Promise<AgentConversationHandle>;
export declare function endAgentConversation(options?: {
contextPath?: string;
env?: NodeJS.ProcessEnv;
}): Promise<AgentConversationHandle>;
export declare function agentConversationEnvironmentVariables(conversation: AgentConversationContext, contextPath: string): Record<string, string>;
export declare function resolveShopifyAgentEnvironmentVariables(env?: NodeJS.ProcessEnv): Promise<Record<string, string>>;
Existing type declarationsWe found no diffs with existing type declarations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

WHY are these changes introduced?
This is an exploratory prototype for moving broader agent conversation bookkeeping into Shopify CLI instead of requiring every harness to rebuild the full
SHOPIFY_CLI_AGENT*payload on every command.The main question behind the prototype is:
This PR is meant to demonstrate the integration shape, not to claim the API is final.
WHAT is this pull request doing?
Prototype changes:
conv_<uuid>)SHOPIFY_CLI_AGENT_CONTEXTinto effectiveSHOPIFY_CLI_AGENT*env varsshopify agent conversation startshopify agent conversation inspectshopify agent conversation endenv_shopify_variablesImportant non-goals for this prototype:
env_shopify_variablesExample prompt → CLI execution flow
One possible future flow this prototype is trying to enable:
User prompt to an agent
Agent / harness starts one broader CLI conversation for the session
shopify agent conversation start \ --conversation-id "$CONVERSATION_ID" \ --agent pi \ --agent-version 0.70.2 \ --provider shopify \ --harness pi \ --model gpt-5 \ --jsonExample JSON response:
{ "conversationId": "conv_123", "contextPath": "/tmp/tmp-abc123/shopify-agent-conversation.json", "agent": "pi", "agentVersion": "0.70.2", "provider": "shopify", "harness": "pi", "model": "gpt-5", "startedAt": "2026-05-04T16:00:00.000Z" }Agent executes one or more Shopify CLI commands during that conversation
A later command in the same broader conversation would reuse the same context path and only change the run ID as needed:
Agent can inspect or end the conversation explicitly
That gives the host a CLI-owned conversation handle while keeping per-run boundaries explicit.
How to test your changes?
Focused checks used for the prototype:
Optional manual sanity check:
Post-release steps
None. This is exploratory prototype work.
Exploration notes / open questions
agent,provider,model,harness, orconversation_idgraduate to first-class Monorail fields instead of staying insideenv_shopify_variables?shopify agent conversation ..., or should CLI expose a thinner helper surface?Checklist
patch) and added a changeset withpnpm changeset add