@@ -19,7 +19,6 @@ import type {
1919import { UI } from "../ui"
2020import { ModelsDev } from "@opencode-ai/core/models-dev"
2121import { InstanceRef } from "@/effect/instance-ref"
22- import { SessionShare } from "@/share/session"
2322import { Session } from "@/session/session"
2423import type { SessionID } from "../../session/schema"
2524import { MessageID , PartID } from "../../session/schema"
@@ -380,7 +379,6 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
380379 if ( ! ctx ) return yield * Effect . die ( "InstanceRef not provided" )
381380 const gitSvc = yield * Git . Service
382381 const sessionSvc = yield * Session . Service
383- const sessionShare = yield * SessionShare . Service
384382 const sessionPrompt = yield * SessionPrompt . Service
385383 const events = yield * EventV2Bridge . Service
386384 const runLocalEffect = < A , E > ( effect : Effect . Effect < A , E > ) =>
@@ -407,7 +405,6 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
407405 const { providerID, modelID } = normalizeModel ( )
408406 const variant = process . env [ "VARIANT" ] || undefined
409407 const runId = normalizeRunId ( )
410- const share = normalizeShare ( )
411408 const oidcBaseUrl = normalizeOidcBaseUrl ( )
412409 const { owner, repo } = context . repo
413410 // For repo events (schedule, workflow_dispatch), payload has no issue/comment data
@@ -428,14 +425,12 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
428425 ? ( payload as IssueCommentEvent | IssuesEvent ) . issue . number
429426 : ( payload as PullRequestEvent | PullRequestReviewCommentEvent ) . pull_request . number
430427 const runUrl = `/${ owner } /${ repo } /actions/runs/${ runId } `
431- const shareBaseUrl = isMock ? "https://dev.opencode.ai" : "https://opencode.ai"
432428
433429 let appToken : string
434430 let octoRest : Octokit
435431 let octoGraph : typeof graphql
436432 let gitConfig : string
437433 let session : { id : SessionID ; title : string ; version : string }
438- let shareId : string | undefined
439434 let exitCode = 0
440435 let githubClientReady = false
441436 type PromptFiles = Awaited < ReturnType < typeof getUserPrompt > > [ "promptFiles" ]
@@ -512,12 +507,6 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
512507 } ) ,
513508 )
514509 await subscribeSessionEvents ( )
515- shareId = await ( async ( ) => {
516- if ( share === false ) return
517- if ( ! share && repoData . data . private ) return
518- await runLocalEffect ( sessionShare . share ( session . id ) )
519- return session . id . slice ( - 8 )
520- } ) ( )
521510 console . log ( "opencode session" , session . id )
522511
523512 // Handle event types:
@@ -547,7 +536,7 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
547536 repoData . data . default_branch ,
548537 branch ,
549538 summary ,
550- `${ response } \n\nTriggered by ${ triggerType } ${ footer ( { image : true } ) } ` ,
539+ `${ response } \n\nTriggered by ${ triggerType } ${ footer ( ) } ` ,
551540 )
552541 if ( pr ) {
553542 console . log ( `Created PR #${ pr } ` )
@@ -576,8 +565,7 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
576565 const summary = await summarize ( response )
577566 await pushToLocalBranch ( summary , uncommittedChanges )
578567 }
579- const hasShared = prData . comments . nodes . some ( ( c ) => c . body . includes ( `${ shareBaseUrl } /s/${ shareId } ` ) )
580- await createComment ( `${ response } ${ footer ( { image : ! hasShared } ) } ` )
568+ await createComment ( `${ response } ${ footer ( ) } ` )
581569 await removeReaction ( commentType )
582570 }
583571 // Fork PR
@@ -594,8 +582,7 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
594582 const summary = await summarize ( response )
595583 await pushToForkBranch ( summary , prData , uncommittedChanges )
596584 }
597- const hasShared = prData . comments . nodes . some ( ( c ) => c . body . includes ( `${ shareBaseUrl } /s/${ shareId } ` ) )
598- await createComment ( `${ response } ${ footer ( { image : ! hasShared } ) } ` )
585+ await createComment ( `${ response } ${ footer ( ) } ` )
599586 await removeReaction ( commentType )
600587 }
601588 }
@@ -610,7 +597,7 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
610597 if ( switched ) {
611598 // Agent switched branches (likely created its own branch/PR).
612599 // Don't push the stale infrastructure branch — just comment.
613- await createComment ( `${ response } ${ footer ( { image : true } ) } ` )
600+ await createComment ( `${ response } ${ footer ( ) } ` )
614601 await removeReaction ( commentType )
615602 } else if ( dirty ) {
616603 const summary = await summarize ( response )
@@ -619,16 +606,16 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
619606 repoData . data . default_branch ,
620607 branch ,
621608 summary ,
622- `${ response } \n\nCloses #${ issueId } ${ footer ( { image : true } ) } ` ,
609+ `${ response } \n\nCloses #${ issueId } ${ footer ( ) } ` ,
623610 )
624611 if ( pr ) {
625- await createComment ( `Created PR #${ pr } ${ footer ( { image : true } ) } ` )
612+ await createComment ( `Created PR #${ pr } ${ footer ( ) } ` )
626613 } else {
627- await createComment ( `${ response } ${ footer ( { image : true } ) } ` )
614+ await createComment ( `${ response } ${ footer ( ) } ` )
628615 }
629616 await removeReaction ( commentType )
630617 } else {
631- await createComment ( `${ response } ${ footer ( { image : true } ) } ` )
618+ await createComment ( `${ response } ${ footer ( ) } ` )
632619 await removeReaction ( commentType )
633620 }
634621 }
@@ -677,14 +664,6 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
677664 return value
678665 }
679666
680- function normalizeShare ( ) {
681- const value = process . env [ "SHARE" ]
682- if ( ! value ) return undefined
683- if ( value === "true" ) return true
684- if ( value === "false" ) return false
685- throw new Error ( `Invalid share value: ${ value } . Share must be a boolean.` )
686- }
687-
688667 function normalizeUseGithubToken ( ) {
689668 const value = process . env [ "USE_GITHUB_TOKEN" ]
690669 if ( ! value ) return false
@@ -1351,18 +1330,8 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
13511330 }
13521331 }
13531332
1354- function footer ( opts ?: { image ?: boolean } ) {
1355- const image = ( ( ) => {
1356- if ( ! shareId ) return ""
1357- if ( ! opts ?. image ) return ""
1358-
1359- const titleAlt = encodeURIComponent ( session . title . substring ( 0 , 50 ) )
1360- const title64 = Buffer . from ( session . title . substring ( 0 , 700 ) , "utf8" ) . toString ( "base64" )
1361-
1362- return `<a href="${ shareBaseUrl } /s/${ shareId } "><img width="200" alt="${ titleAlt } " src="https://social-cards.sst.dev/opencode-share/${ title64 } .png?model=${ providerID } /${ modelID } &version=${ session . version } &id=${ shareId } " /></a>\n`
1363- } ) ( )
1364- const shareUrl = shareId ? `[opencode session](${ shareBaseUrl } /s/${ shareId } ) | ` : ""
1365- return `\n\n${ image } ${ shareUrl } [github run](${ runUrl } )`
1333+ function footer ( ) {
1334+ return `\n\n[github run](${ runUrl } )`
13661335 }
13671336
13681337 async function fetchRepo ( ) {
0 commit comments