Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Issues and pull requests replace intents and attempts | 1 | import { env } from "cloudflare:workers"; |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 2 | import { Bot, ExternalLink, GitCommitHorizontal, GitMerge, Play, Sparkles } from "lucide-react"; |
| Merge branch 'worktree-agent-a985c01f43538af01' | 3 | import { Form, Link, redirect } from "react-router"; |
| Issues and pull requests replace intents and attempts | 4 | |
| g1t is the stored author of what it opens; the person who asked is requested_by and keeps the author's rights | 5 | import { type Pull, PROVIDERS, workOwner } from "@g1t/contracts"; |
| Issues and pull requests replace intents and attempts | 6 | |
| 7 | import type { Route } from "./+types/issue"; | |
| Social cards for every page: og.g1t.sh | 8 | import { excerpt, page } from "../../lib/meta"; |
| Issues and pull requests replace intents and attempts | 9 | import { Markdown } from "../../components/markdown"; |
| Agents and memory, checks and conflicts, profiles, slug renames, custom domains | 10 | import { AgentStepLine } from "../../components/agents"; |
| Issues and pull requests replace intents and attempts | 11 | import { |
| 12 | Avatar, | |
| 13 | CopyLine, | |
| 14 | EmptyState, | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 15 | ComputeNote, |
| Issues and pull requests replace intents and attempts | 16 | ErrorText, |
| 17 | Input, | |
| Merge branch 'worktree-agent-a985c01f43538af01' | 18 | SubmitButton, |
| Issues and pull requests replace intents and attempts | 19 | Textarea, |
| 20 | TimeAgo, | |
| 21 | } from "../../components/ui"; | |
| Workspace names and icons, and a component kit for every control | 22 | import { CheckboxOption } from "../../components/ui/checkbox"; |
| Acceptance checks in sandboxes, line comments and review verdicts | 23 | import { CheckBadge } from "../../components/checks"; |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 24 | import { |
| 25 | Assignee, | |
| 26 | AssigneeStack, | |
| 27 | ChangeSize, | |
| 28 | CommentForm, | |
| 29 | CommentList, | |
| 30 | PeoplePicker, | |
| 31 | IssueState, | |
| 32 | Label, | |
| Agents and memory, checks and conflicts, profiles, slug renames, custom domains | 33 | PersonLink, |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 34 | PullIcon, |
| 35 | plainText, | |
| 36 | } from "../../components/work"; | |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 37 | import { notFound } from "../../lib/not-found.server"; |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 38 | import { openedBy } from "../../lib/opened-by"; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 39 | import { computeNoteFor } from "../../lib/compute.server"; |
| Inbox on the site: reasons, a reason filter, Subscribe, Watch and settings | 40 | import { identity, inbox, integrations, work } from "../../lib/services.server"; |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 41 | import { assertSameOrigin, getViewer, requireUser, roleIn } from "../../lib/session.server"; |
| Inbox on the site: reasons, a reason filter, Subscribe, Watch and settings | 42 | import { accessTo, refusal, repoFor } from "../../lib/access.server"; |
| 43 | import { SubscriptionBox } from "../../components/notifications"; | |
| A click away from a live page arrives: pages stop refreshing themselves while a navigation is pending | 44 | import { useRefreshWhile } from "../../lib/refresh"; |
| Issues and pull requests replace intents and attempts | 45 | |
| 46 | ||
| Social cards for every page: og.g1t.sh | 47 | export function meta({ loaderData, params, ...args }: Route.MetaArgs) { |
| 48 | const issue = loaderData?.issue; | |
| 49 | const title = issue ? `${issue.title} · Issue #${issue.number} · ` : ""; | |
| 50 | const state = issue?.state === "open" ? "Open" : issue?.reason === "not_planned" ? "Closed as not planned" : "Closed"; | |
| 51 | const body = excerpt(issue?.body); | |
| 52 | return page(args, { | |
| 53 | title: `${title}${params.owner}/${params.repo} · g1t`, | |
| 54 | description: issue | |
| g1t is the stored author of what it opens; the person who asked is requested_by and keeps the author's rights | 55 | ? `${state} issue #${issue.number} on ${params.owner}/${params.repo}, opened by ${issue.author.username}${issue.requestedBy ? ` for ${issue.requestedBy.username}` : ""}.${body ? ` ${body}` : ""}` |
| Social cards for every page: og.g1t.sh | 56 | : null, |
| 57 | // The card shows the title and the state. | |
| 58 | version: issue ? [issue.title, issue.state, issue.reason] : undefined, | |
| 59 | type: "article", | |
| 60 | }); | |
| Issues and pull requests replace intents and attempts | 61 | } |
| 62 | ||
| 63 | export async function loader({ params, context }: Route.LoaderArgs) { | |
| 64 | const viewer = getViewer(context); | |
| 65 | const path = { namespace: params.owner, name: params.repo }; | |
| 66 | const number = Number(params.number); | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 67 | // At once: only the plan's note waits for the viewer's role. Putting an |
| 68 | // agent on it needs Write: Read cannot spend compute. | |
| 69 | const access = accessTo(context, params); | |
| Inbox on the site: reasons, a reason filter, Subscribe, Watch and settings | 70 | const [{ can }, found, labels, agentsEnabled, members, links, computeNote, subscription] = await Promise.all([ |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 71 | access, |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 72 | work.getIssue(path, number, viewer), |
| 73 | work.listLabels(path, viewer), | |
| g1t's agents only for listed workspaces, whatever the state of billing | 74 | env.RUNNER.enabled(viewer, path), |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 75 | // A member picks assignees from the workspace's people. |
| 76 | roleIn(viewer, params.owner) ? identity.listMembers(params.owner, viewer) : null, | |
| Integrations: your own model provider, alerts that open issues, tickets agents read | 77 | // What it is tied to outside g1t. Shown only once the issue is known visible. |
| 78 | integrations.links(path, number).catch(() => []), | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 79 | // Before a member assigns g1t: whether the workspace's plan lets it start. |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 80 | access.then(({ can }) => (can.run ? computeNoteFor(params.owner, "agent") : null)), |
| Inbox on the site: reasons, a reason filter, Subscribe, Watch and settings | 81 | // Whether the viewer hears of it, for the sidebar's Notifications. |
| 82 | viewer | |
| 83 | ? repoFor(context, params).then((repo) => | |
| 84 | repo.ok ? inbox.subscription(viewer, { repoId: repo.value.id, number }).catch(() => null) : null, | |
| 85 | ) | |
| 86 | : null, | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 87 | ]); |
| Issues and pull requests replace intents and attempts | 88 | if (!found.ok) { |
| 89 | // Issues and pull requests share numbers; this one may be a pull request. | |
| 90 | const pull = await work.getPull(path, number, viewer); | |
| 91 | if (pull.ok) throw redirect(`/${params.owner}/${params.repo}/pull/${number}`); | |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 92 | throw notFound("issue"); |
| Issues and pull requests replace intents and attempts | 93 | } |
| 94 | const { issue } = found.value; | |
| 95 | return { | |
| 96 | ...found.value, | |
| 97 | viewer, | |
| 98 | labels: labels.ok ? labels.value : [], | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 99 | agentsEnabled, |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 100 | computeNote, |
| Integrations: your own model provider, alerts that open issues, tickets agents read | 101 | links, |
| Inbox on the site: reasons, a reason filter, Subscribe, Watch and settings | 102 | subscription, |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 103 | members: members?.ok ? members.value.map((member) => member.username) : [], |
| g1t is the stored author of what it opens; the person who asked is requested_by and keeps the author's rights | 104 | // The author can close and reopen their own issue, and whoever g1t's |
| 105 | // agent filed one for, that one; Triage and up, anyone's. | |
| 106 | canManage: viewer != null && (viewer.id === workOwner(issue).id || can.triage), | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 107 | can, |
| Issues and pull requests replace intents and attempts | 108 | }; |
| 109 | } | |
| 110 | ||
| 111 | export async function action({ request, params, context }: Route.ActionArgs) { | |
| 112 | assertSameOrigin(request); | |
| 113 | const user = requireUser(context, request); | |
| 114 | const form = await request.formData(); | |
| 115 | const path = { namespace: params.owner, name: params.repo }; | |
| 116 | const number = Number(params.number); | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 117 | // What each form needs; closing your own issue is checked by work. |
| 118 | const needed = form.get("action") === "run-hosted" ? "run" : form.get("action") === "assign" || form.get("action") === "labels" ? "triage" : null; | |
| 119 | const refused = needed ? await refusal(context, params, needed) : null; | |
| 120 | if (refused) return { error: refused, action: String(form.get("action")) }; | |
| Issues and pull requests replace intents and attempts | 121 | |
| 122 | switch (form.get("action")) { | |
| 123 | case "run-hosted": { | |
| 124 | const result = await env.RUNNER.run(user, path, number, { | |
| 125 | instructions: String(form.get("instructions") ?? ""), | |
| 126 | }); | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 127 | return result.ok ? null : { error: result.error.message, action: "run-hosted" }; |
| Issues and pull requests replace intents and attempts | 128 | } |
| 129 | case "open-pull": { | |
| 130 | const result = await work.openPull(user, path, { | |
| 131 | issue: number, | |
| 132 | agent: String(form.get("agent") ?? ""), | |
| 133 | runtime: "external", | |
| 134 | }); | |
| 135 | if (!result.ok) return { error: result.error.message }; | |
| 136 | throw redirect(`/${params.owner}/${params.repo}/pull/${result.value.number}`); | |
| 137 | } | |
| 138 | case "comment": { | |
| Acceptance checks in sandboxes, line comments and review verdicts | 139 | const result = await work.addComment(user, path, number, { |
| 140 | body: String(form.get("body") ?? ""), | |
| 141 | }); | |
| Issues and pull requests replace intents and attempts | 142 | return result.ok ? null : { error: result.error.message }; |
| 143 | } | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 144 | case "assign": { |
| 145 | const result = await work.updateIssue(user, path, number, { | |
| 146 | assignees: [ | |
| 147 | ...form.getAll("assignee").map(String), | |
| 148 | ...String(form.get("others") ?? "").split(/[\s,]+/), | |
| 149 | ], | |
| 150 | }); | |
| 151 | return result.ok ? null : { error: result.error.message }; | |
| 152 | } | |
| Issues and pull requests replace intents and attempts | 153 | case "labels": { |
| 154 | const result = await work.updateIssue(user, path, number, { | |
| 155 | labels: [ | |
| 156 | ...form.getAll("label").map(String), | |
| 157 | ...String(form.get("labels") ?? "").split(","), | |
| 158 | ], | |
| 159 | }); | |
| 160 | return result.ok ? null : { error: result.error.message }; | |
| 161 | } | |
| 162 | case "reopen": { | |
| 163 | const result = await work.reopenIssue(user, path, number); | |
| 164 | return result.ok ? null : { error: result.error.message }; | |
| 165 | } | |
| 166 | default: { | |
| 167 | const result = await work.closeIssue( | |
| 168 | user, | |
| 169 | path, | |
| 170 | number, | |
| 171 | form.get("action") === "close-not-planned" ? "not_planned" : "completed", | |
| 172 | ); | |
| 173 | return result.ok ? null : { error: result.error.message }; | |
| 174 | } | |
| 175 | } | |
| 176 | } | |
| 177 | ||
| 178 | /** What became of a pull request, in a few words. */ | |
| 179 | function outcome(pull: Pull): string { | |
| 180 | if (pull.status === "merged") return `Merged by ${pull.mergedBy ?? "someone"}`; | |
| 181 | if (pull.supersededBy != null) return `Closed · #${pull.supersededBy} was merged instead`; | |
| 182 | if (pull.status === "closed") return "Closed without merging"; | |
| 183 | if (pull.status === "draft") return "Draft · in progress"; | |
| 184 | return "Ready for review"; | |
| 185 | } | |
| 186 | ||
| 187 | function PullRow({ pull, base }: { pull: Pull; base: string }) { | |
| 188 | const merged = pull.status === "merged"; | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 189 | const opener = openedBy(pull); |
| Issues and pull requests replace intents and attempts | 190 | return ( |
| 191 | <li> | |
| 192 | <Link | |
| 193 | to={`${base}/pull/${pull.number}`} | |
| 194 | className={`block rounded-xl border p-4 transition-colors ${ | |
| 195 | merged | |
| 196 | ? "border-merged/40 bg-merged/5 hover:border-merged/70" | |
| 197 | : "border-line bg-surface hover:border-line-strong" | |
| 198 | } ${pull.status === "closed" ? "opacity-70" : ""}`} | |
| 199 | > | |
| 200 | <div className="flex flex-wrap items-center gap-x-3 gap-y-1"> | |
| 201 | <PullIcon status={pull.status} /> | |
| 202 | <span className="font-medium"> | |
| 203 | {pull.title} <span className="font-normal text-faint">#{pull.number}</span> | |
| 204 | </span> | |
| 205 | {pull.status === "draft" && ( | |
| 206 | <span className="size-1.5 animate-pulse rounded-full bg-accent" /> | |
| 207 | )} | |
| 208 | <span className="ml-auto flex items-center gap-3 text-xs text-faint"> | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 209 | <ChangeSize files={pull.files} /> |
| Acceptance checks in sandboxes, line comments and review verdicts | 210 | <CheckBadge status={pull.checkStatus} /> |
| Issues and pull requests replace intents and attempts | 211 | <span className="flex items-center gap-1 font-mono"> |
| 212 | <GitCommitHorizontal size={13} /> | |
| 213 | {pull.headCommit?.slice(0, 7) ?? "no commits"} | |
| 214 | </span> | |
| 215 | <TimeAgo at={pull.updatedAt} /> | |
| 216 | </span> | |
| 217 | </div> | |
| 218 | <p className="mt-1.5 flex flex-wrap items-center gap-x-2 text-xs text-muted"> | |
| 219 | <span className={merged ? "font-medium text-merged" : ""}>{outcome(pull)}</span> | |
| 220 | <span className="text-faint">·</span> | |
| 221 | <span className="flex items-center gap-1 font-mono"> | |
| 222 | <Bot size={12} /> | |
| 223 | {pull.agent} | |
| 224 | </span> | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 225 | {opener.requestedBy ? ( |
| 226 | <span className="text-faint">· requested by {opener.requestedBy}</span> | |
| 227 | ) : ( | |
| 228 | <> | |
| 229 | {pull.runtime === "hosted" && <span className="text-faint">on g1t</span>} | |
| 230 | <span className="text-faint">· opened by {opener.name}</span> | |
| 231 | </> | |
| 232 | )} | |
| Issues and pull requests replace intents and attempts | 233 | </p> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 234 | {pull.body && ( |
| 235 | <p className="mt-2 line-clamp-2 text-sm text-muted">{plainText(pull.body)}</p> | |
| 236 | )} | |
| Issues and pull requests replace intents and attempts | 237 | </Link> |
| 238 | </li> | |
| 239 | ); | |
| 240 | } | |
| 241 | ||
| 242 | export default function IssuePage({ loaderData, actionData, params }: Route.ComponentProps) { | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 243 | const { issue, pulls, comments, viewer, labels, agentsEnabled, members, canManage, can } = loaderData; |
| Issues and pull requests replace intents and attempts | 244 | |
| 245 | // Follow agents at work without a manual reload. | |
| Acceptance checks in sandboxes, line comments and review verdicts | 246 | const running = pulls.some( |
| 247 | (pull) => | |
| 248 | pull.status === "draft" || | |
| 249 | pull.checkStatus === "queued" || | |
| 250 | pull.checkStatus === "running", | |
| 251 | ); | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 252 | // The pull request g1t's agent has in progress for this issue, if any. |
| 253 | const assigned = [...pulls] | |
| 254 | .reverse() | |
| 255 | .find( | |
| 256 | (pull) => | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 257 | pull.agent === "g1t" && |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 258 | pull.runtime === "hosted" && |
| 259 | (pull.status === "draft" || pull.status === "open"), | |
| 260 | ); | |
| A click away from a live page arrives: pages stop refreshing themselves while a navigation is pending | 261 | useRefreshWhile(Boolean(running || assigned)); |
| Issues and pull requests replace intents and attempts | 262 | |
| Merge branch 'worktree-agent-a985c01f43538af01' | 263 | // A refusal to start g1t shows by its button; every other error below the discussion. |
| 264 | const runError = actionData && "action" in actionData && actionData.action === "run-hosted"; | |
| Issues and pull requests replace intents and attempts | 265 | const base = `/${params.owner}/${params.repo}`; |
| 266 | const open = issue.state === "open"; | |
| 267 | const reference = `${params.owner}/${params.repo}#${issue.number}`; | |
| 268 | const resolver = pulls.find((pull) => pull.number === issue.resolvedBy); | |
| 269 | // The merged pull request first, then the ones still in play, then the rest. | |
| 270 | const rank = { merged: 0, open: 1, draft: 2, closed: 3 } as const; | |
| 271 | const ordered = [...pulls].sort( | |
| 272 | (a, b) => rank[a.status] - rank[b.status] || a.number - b.number, | |
| 273 | ); | |
| 274 | ||
| 275 | return ( | |
| 276 | <div className="grid gap-8 lg:grid-cols-[1fr_19rem]"> | |
| 277 | <div className="min-w-0"> | |
| 278 | <h2 className="text-2xl font-semibold tracking-tight text-balance"> | |
| 279 | {issue.title} <span className="font-normal text-faint">#{issue.number}</span> | |
| 280 | </h2> | |
| 281 | <div className="mt-3 flex flex-wrap items-center gap-x-3 gap-y-2 text-sm text-muted"> | |
| 282 | <IssueState issue={issue} /> | |
| 283 | <span className="flex items-center gap-2"> | |
| 284 | <Avatar name={issue.author.username} size={18} /> | |
| 285 | <span> | |
| Agents and memory, checks and conflicts, profiles, slug renames, custom domains | 286 | <PersonLink name={issue.author.username} className="font-medium text-fg hover:underline" /> opened this{" "} |
| g1t is the stored author of what it opens; the person who asked is requested_by and keeps the author's rights | 287 | {issue.requestedBy && ( |
| 288 | <> | |
| 289 | for{" "} | |
| 290 | <PersonLink name={issue.requestedBy.username} className="font-medium text-fg-soft hover:underline" />{" "} | |
| 291 | </> | |
| 292 | )} | |
| Issues and pull requests replace intents and attempts | 293 | <TimeAgo at={issue.createdAt} /> |
| 294 | </span> | |
| 295 | </span> | |
| 296 | {issue.labels.map((name) => ( | |
| 297 | <Label key={name} name={name} /> | |
| 298 | ))} | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 299 | {open && issue.agent && <Assignee agent={issue.agent} />} |
| Issues and pull requests replace intents and attempts | 300 | </div> |
| 301 | ||
| 302 | {issue.resolvedBy != null && ( | |
| 303 | <Link | |
| 304 | to={`${base}/pull/${issue.resolvedBy}`} | |
| 305 | className="mt-5 flex items-center gap-3 rounded-xl border border-merged/40 bg-merged/5 px-4 py-3 text-sm transition-colors hover:border-merged/70" | |
| 306 | > | |
| 307 | <GitMerge size={18} className="shrink-0 text-merged" /> | |
| 308 | <span> | |
| 309 | Resolved by{" "} | |
| 310 | <span className="font-medium"> | |
| 311 | {resolver?.title ?? "pull request"} #{issue.resolvedBy} | |
| 312 | </span> | |
| 313 | {resolver?.mergedBy && ( | |
| 314 | <span className="text-muted"> | |
| 315 | , merged by {resolver.mergedBy}{" "} | |
| 316 | {resolver.mergedAt && <TimeAgo at={resolver.mergedAt} />} | |
| 317 | </span> | |
| 318 | )} | |
| 319 | </span> | |
| 320 | </Link> | |
| 321 | )} | |
| 322 | ||
| 323 | {issue.body && ( | |
| 324 | <div className="mt-5 rounded-xl border border-line bg-surface p-5"> | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 325 | <Markdown source={issue.body} repo={{ namespace: params.owner, name: params.repo }} /> |
| Issues and pull requests replace intents and attempts | 326 | </div> |
| 327 | )} | |
| 328 | ||
| 329 | <div className="mt-10 flex items-baseline justify-between"> | |
| 330 | <h3 className="font-semibold tracking-tight">Pull requests</h3> | |
| 331 | <p className="text-sm text-muted"> | |
| 332 | {pulls.length === 0 | |
| 333 | ? "None yet" | |
| 334 | : `${pulls.length} for this issue${ | |
| 335 | pulls.some((pull) => pull.status === "merged") ? "" : ", none merged" | |
| 336 | }`} | |
| 337 | </p> | |
| 338 | </div> | |
| 339 | <div className="mt-3"> | |
| 340 | {pulls.length === 0 ? ( | |
| 341 | <EmptyState title="Nobody has worked on this yet"> | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 342 | Put g1t on it, or point your own agent at{" "} |
| Issues and pull requests replace intents and attempts | 343 | <code className="font-mono">{reference}</code>. |
| 344 | </EmptyState> | |
| 345 | ) : ( | |
| 346 | <ol className="space-y-3"> | |
| 347 | {ordered.map((pull) => ( | |
| 348 | <PullRow key={pull.id} pull={pull} base={base} /> | |
| 349 | ))} | |
| 350 | </ol> | |
| 351 | )} | |
| 352 | </div> | |
| 353 | ||
| 354 | <h3 className="mt-10 font-semibold tracking-tight">Discussion</h3> | |
| 355 | <div className="mt-3"> | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 356 | <div className="space-y-4"> |
| 357 | <CommentList comments={comments} base={base} /> | |
| 358 | <CommentForm author={viewer?.username ?? null} resetKey={comments.length} /> | |
| 359 | {canManage && ( | |
| 360 | <Form method="post" className="flex flex-wrap justify-end gap-2"> | |
| 361 | {open ? ( | |
| 362 | <> | |
| Merge branch 'worktree-agent-a985c01f43538af01' | 363 | <SubmitButton variant="quiet" name="action" value="close-not-planned" pending="Closing…"> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 364 | Close as not planned |
| Merge branch 'worktree-agent-a985c01f43538af01' | 365 | </SubmitButton> |
| 366 | <SubmitButton variant="quiet" name="action" value="close-completed" pending="Closing…"> | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 367 | Close issue |
| Merge branch 'worktree-agent-a985c01f43538af01' | 368 | </SubmitButton> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 369 | </> |
| 370 | ) : ( | |
| Merge branch 'worktree-agent-a985c01f43538af01' | 371 | <SubmitButton variant="quiet" name="action" value="reopen" pending="Reopening…"> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 372 | Reopen issue |
| Merge branch 'worktree-agent-a985c01f43538af01' | 373 | </SubmitButton> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 374 | )} |
| 375 | </Form> | |
| 376 | )} | |
| 377 | </div> | |
| Issues and pull requests replace intents and attempts | 378 | </div> |
| 379 | <div className="mt-2"> | |
| Merge branch 'worktree-agent-a985c01f43538af01' | 380 | {!runError && <ErrorText>{actionData?.error}</ErrorText>} |
| Issues and pull requests replace intents and attempts | 381 | </div> |
| 382 | </div> | |
| 383 | ||
| 384 | <aside className="space-y-6"> | |
| Integrations: your own model provider, alerts that open issues, tickets agents read | 385 | {loaderData.links.length > 0 && ( |
| 386 | <section> | |
| 387 | <h3 className="text-sm font-medium">From outside g1t</h3> | |
| 388 | <ul className="mt-2 space-y-1.5 text-sm"> | |
| 389 | {loaderData.links.map((link) => ( | |
| 390 | <li key={`${link.connectionId}-${link.key}`}> | |
| 391 | <a | |
| 392 | href={link.url} | |
| 393 | target="_blank" | |
| 394 | rel="noreferrer" | |
| 395 | className="group flex items-center gap-2 rounded-lg border border-line px-2.5 py-2 transition-colors hover:border-line-strong" | |
| 396 | > | |
| 397 | <span className="min-w-0 grow"> | |
| 398 | <span className="block truncate font-medium"> | |
| 399 | {PROVIDERS[link.provider].label} <span className="font-mono text-muted">{link.key}</span> | |
| 400 | </span> | |
| 401 | <span className="block text-xs text-faint"> | |
| 402 | {link.count > 1 ? `Seen ${link.count} times, last ` : "Linked "} | |
| 403 | <TimeAgo at={link.count > 1 ? link.lastSeen : link.firstSeen} /> | |
| 404 | </span> | |
| 405 | </span> | |
| 406 | <ExternalLink size={13} className="shrink-0 text-faint group-hover:text-fg" /> | |
| 407 | </a> | |
| 408 | </li> | |
| 409 | ))} | |
| 410 | </ul> | |
| 411 | </section> | |
| 412 | )} | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 413 | <section> |
| 414 | <h3 className="text-sm font-medium">Assignees</h3> | |
| 415 | <ul className="mt-2 space-y-1.5 text-sm"> | |
| 416 | {open && assigned && ( | |
| 417 | <li> | |
| 418 | <Link | |
| 419 | to={`${base}/pull/${assigned.number}`} | |
| 420 | className="flex items-center gap-2 rounded-lg border border-accent/30 bg-accent/5 px-2.5 py-2 transition-colors hover:border-accent/60" | |
| 421 | > | |
| 422 | <Sparkles size={15} className="shrink-0 text-accent" /> | |
| 423 | <span className="min-w-0 grow"> | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 424 | <span className="block font-mono text-xs font-medium">g1t</span> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 425 | <span className="block truncate text-xs text-muted"> |
| 426 | {assigned.status === "draft" | |
| 427 | ? "Making the change" | |
| 428 | : "Seeing it through checks and review"}{" "} | |
| 429 | · #{assigned.number} | |
| 430 | </span> | |
| Agents and memory, checks and conflicts, profiles, slug renames, custom domains | 431 | <AgentStepLine owner={params.owner} repo={params.repo} number={assigned.number} /> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 432 | </span> |
| 433 | <span className="size-1.5 shrink-0 animate-pulse rounded-full bg-accent" /> | |
| 434 | </Link> | |
| 435 | </li> | |
| 436 | )} | |
| 437 | {issue.assignees.map((name) => ( | |
| 438 | <li key={name} className="flex items-center gap-2 px-1"> | |
| 439 | <Avatar name={name} size={20} /> | |
| 440 | <span className="grow truncate font-mono text-xs">{name}</span> | |
| 441 | </li> | |
| 442 | ))} | |
| 443 | {open && issue.queued && !assigned && ( | |
| 444 | <li className="flex items-center gap-2 rounded-lg border border-line bg-surface px-2.5 py-2"> | |
| 445 | <Sparkles size={15} className="shrink-0 text-faint" /> | |
| 446 | <span className="min-w-0 grow"> | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 447 | <span className="block font-mono text-xs font-medium">g1t</span> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 448 | <span className="block text-xs text-muted"> |
| 449 | {issue.blockedBy.length > 0 | |
| 450 | ? "Queued. Starts when what this depends on has merged." | |
| 451 | : "Queued. Starts as soon as there is room."} | |
| 452 | </span> | |
| 453 | </span> | |
| 454 | </li> | |
| 455 | )} | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 456 | {!open && resolver && resolver.agent === "g1t" && ( |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 457 | <li> |
| 458 | <Link | |
| 459 | to={`${base}/pull/${resolver.number}`} | |
| 460 | className="flex items-center gap-2 rounded-lg border border-line bg-surface px-2.5 py-2 transition-colors hover:border-line-strong" | |
| 461 | > | |
| 462 | <Sparkles size={15} className="shrink-0 text-merged" /> | |
| 463 | <span className="min-w-0 grow"> | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 464 | <span className="block font-mono text-xs font-medium">g1t</span> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 465 | <span className="block truncate text-xs text-muted"> |
| 466 | Resolved it with #{resolver.number} | |
| 467 | </span> | |
| 468 | </span> | |
| 469 | </Link> | |
| 470 | </li> | |
| 471 | )} | |
| 472 | {issue.assignees.length === 0 && | |
| 473 | !(open && (assigned || issue.queued)) && | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 474 | !(!open && resolver?.agent === "g1t") && ( |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 475 | <li className="px-1 text-xs text-faint">No one yet.</li> |
| 476 | )} | |
| 477 | </ul> | |
| 478 | {issue.blockedBy.length > 0 && ( | |
| 479 | <p className="mt-3 text-xs text-muted"> | |
| 480 | Depends on{" "} | |
| 481 | {issue.blockedBy.map((number, index) => ( | |
| 482 | <span key={number}> | |
| 483 | {index > 0 && ", "} | |
| 484 | <Link | |
| 485 | to={`${base}/issues/${number}`} | |
| 486 | className="font-medium text-fg hover:underline" | |
| 487 | > | |
| 488 | #{number} | |
| 489 | </Link> | |
| 490 | </span> | |
| 491 | ))} | |
| 492 | {open ? ", which has to merge first." : "."} | |
| Issues and pull requests replace intents and attempts | 493 | </p> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 494 | )} |
| 495 | ||
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 496 | {open && agentsEnabled && can.run && !assigned && !issue.queued && ( |
| Issues and pull requests replace intents and attempts | 497 | <Form method="post" className="mt-3 space-y-2"> |
| 498 | <input type="hidden" name="action" value="run-hosted" /> | |
| 499 | <div className="*:w-full"> | |
| Merge branch 'worktree-agent-a985c01f43538af01' | 500 | <SubmitButton variant="accent" match={{ action: "run-hosted" }} pending="Starting a sandbox…"> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 501 | <Sparkles size={14} /> |
| Merge branch 'worktree-agent-a985c01f43538af01' | 502 | Assign to g1t |
| 503 | </SubmitButton> | |
| Issues and pull requests replace intents and attempts | 504 | </div> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 505 | <details> |
| 506 | <summary className="cursor-pointer text-xs text-faint hover:text-fg"> | |
| 507 | Add guidance for this run | |
| 508 | </summary> | |
| 509 | <div className="mt-2"> | |
| 510 | <Textarea | |
| 511 | name="instructions" | |
| 512 | rows={2} | |
| 513 | placeholder="On top of the issue's description" | |
| 514 | /> | |
| 515 | </div> | |
| 516 | </details> | |
| 517 | <p className="text-xs text-muted"> | |
| 518 | It opens a pull request and sees it through checks, a review by another | |
| 519 | agent and fixes. You get it back ready to merge. | |
| 520 | </p> | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 521 | <ComputeNote note={loaderData.computeNote} /> |
| Merge branch 'worktree-agent-a985c01f43538af01' | 522 | {runError && <ErrorText>{actionData.error}</ErrorText>} |
| Issues and pull requests replace intents and attempts | 523 | </Form> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 524 | )} |
| 525 | ||
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 526 | {open && !agentsEnabled && can.run && !assigned && !issue.queued && ( |
| New workspaces are told to connect a model, before anything fails | 527 | // Where g1t's agent would be, and what makes it appear. |
| 528 | <div className="mt-3 rounded-lg border border-dashed border-line p-3 text-sm"> | |
| 529 | <p className="flex items-center gap-1.5 font-medium"> | |
| 530 | <Sparkles size={14} className="text-accent" /> | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 531 | g1t |
| New workspaces are told to connect a model, before anything fails | 532 | </p> |
| 533 | <p className="mt-1 text-xs text-muted"> | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 534 | Connect a model provider and g1t can take this issue: it opens a pull request and sees it |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 535 | through checks, review and fixes. Agents run on a paid workspace, or on the free trial. |
| New workspaces are told to connect a model, before anything fails | 536 | </p> |
| 537 | <Link | |
| 538 | to={`/${params.owner}/-/integrations`} | |
| 539 | className="mt-2 inline-block text-xs text-accent hover:underline" | |
| 540 | > | |
| 541 | Connect a model | |
| 542 | </Link> | |
| 543 | </div> | |
| 544 | )} | |
| 545 | ||
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 546 | {viewer && can.triage && open && ( |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 547 | <div className="mt-3 space-y-2"> |
| 548 | {!issue.assignees.includes(viewer.username) && ( | |
| 549 | <Form method="post"> | |
| 550 | <input type="hidden" name="action" value="assign" /> | |
| 551 | {issue.assignees.map((name) => ( | |
| 552 | <input key={name} type="hidden" name="assignee" value={name} /> | |
| 553 | ))} | |
| 554 | <input type="hidden" name="assignee" value={viewer.username} /> | |
| 555 | <div className="*:w-full"> | |
| Merge branch 'worktree-agent-a985c01f43538af01' | 556 | <SubmitButton variant="quiet" name="who" value="self" pending="Assigning…"> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 557 | Assign yourself |
| Merge branch 'worktree-agent-a985c01f43538af01' | 558 | </SubmitButton> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 559 | </div> |
| 560 | </Form> | |
| 561 | )} | |
| 562 | <details className="group"> | |
| 563 | <summary className="cursor-pointer text-xs text-faint hover:text-fg"> | |
| 564 | Assign people | |
| 565 | </summary> | |
| 566 | <Form method="post" className="mt-2 space-y-2" key={issue.assignees.join()}> | |
| 567 | <input type="hidden" name="action" value="assign" /> | |
| 568 | <PeoplePicker name="assignee" members={members} chosen={issue.assignees} /> | |
| Merge branch 'worktree-agent-a985c01f43538af01' | 569 | <SubmitButton variant="quiet" name="who" value="picked" pending="Saving…"> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 570 | Save assignees |
| Merge branch 'worktree-agent-a985c01f43538af01' | 571 | </SubmitButton> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 572 | </Form> |
| 573 | </details> | |
| 574 | </div> | |
| 575 | )} | |
| 576 | </section> | |
| Issues and pull requests replace intents and attempts | 577 | |
| An issue being worked on no longer offers Bring your own agent beside the pull request doing it | 578 | {/* Another way to start the work: not once a pull request is doing it. */} |
| 579 | {open && !pulls.some((pull) => pull.status === "open" || pull.status === "draft") && ( | |
| Issues and pull requests replace intents and attempts | 580 | <section className="rounded-xl border border-line bg-surface p-4"> |
| 581 | <h3 className="text-sm font-medium">Bring your own agent</h3> | |
| 582 | <p className="mt-1 text-xs text-muted"> | |
| 583 | With g1t connected to your agent, ask it to work on this issue. | |
| 584 | </p> | |
| 585 | <div className="mt-3"> | |
| 586 | <CopyLine text={reference} /> | |
| 587 | </div> | |
| 588 | {viewer ? ( | |
| 589 | <Form method="post" className="mt-4 space-y-2 border-t border-line pt-4"> | |
| 590 | <input type="hidden" name="action" value="open-pull" /> | |
| 591 | <p className="text-xs text-muted"> | |
| 592 | Or open a draft pull request yourself and get a fork to push to. | |
| 593 | </p> | |
| 594 | <Input name="agent" placeholder="Who is working, e.g. claude-code" maxLength={60} /> | |
| 595 | <div className="*:w-full"> | |
| Merge branch 'worktree-agent-a985c01f43538af01' | 596 | <SubmitButton match={{ action: "open-pull" }} pending="Opening…"> |
| 597 | Open pull request | |
| 598 | </SubmitButton> | |
| Issues and pull requests replace intents and attempts | 599 | </div> |
| Pull requests from branches | 600 | <p className="text-xs text-muted"> |
| 601 | Already pushed a branch?{" "} | |
| 602 | <Link | |
| 603 | to={`${base}/pulls/new?issue=${issue.number}`} | |
| 604 | className="text-fg underline underline-offset-4" | |
| 605 | > | |
| 606 | Open a pull request from it | |
| 607 | </Link> | |
| 608 | . | |
| 609 | </p> | |
| Issues and pull requests replace intents and attempts | 610 | </Form> |
| 611 | ) : ( | |
| 612 | <p className="mt-4 border-t border-line pt-4 text-sm text-muted"> | |
| 613 | <Link to="/login" className="text-fg underline underline-offset-4"> | |
| 614 | Sign in | |
| 615 | </Link>{" "} | |
| 616 | to open a pull request. | |
| 617 | </p> | |
| 618 | )} | |
| 619 | </section> | |
| 620 | )} | |
| 621 | ||
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 622 | {can.triage && ( |
| Issues and pull requests replace intents and attempts | 623 | <details className="group"> |
| 624 | <summary className="cursor-pointer list-none text-sm font-medium"> | |
| 625 | Labels <span className="text-xs font-normal text-faint group-open:hidden">Edit</span> | |
| 626 | </summary> | |
| 627 | <Form method="post" className="mt-3 space-y-3" key={issue.labels.join()}> | |
| 628 | <input type="hidden" name="action" value="labels" /> | |
| 629 | <div className="flex flex-wrap gap-x-3 gap-y-2"> | |
| 630 | {labels.map((name) => ( | |
| Workspace names and icons, and a component kit for every control | 631 | <CheckboxOption |
| 632 | key={name} | |
| 633 | name="label" | |
| 634 | value={name} | |
| 635 | defaultChecked={issue.labels.includes(name)} | |
| 636 | label={<Label name={name} />} | |
| 637 | className="items-center gap-1.5" | |
| 638 | /> | |
| Issues and pull requests replace intents and attempts | 639 | ))} |
| 640 | </div> | |
| 641 | <Input name="labels" placeholder="New labels, comma separated" /> | |
| Merge branch 'worktree-agent-a985c01f43538af01' | 642 | <SubmitButton variant="quiet" match={{ action: "labels" }} pending="Saving…"> |
| Issues and pull requests replace intents and attempts | 643 | Save labels |
| Merge branch 'worktree-agent-a985c01f43538af01' | 644 | </SubmitButton> |
| Issues and pull requests replace intents and attempts | 645 | </Form> |
| 646 | </details> | |
| 647 | )} | |
| 648 | ||
| Inbox on the site: reasons, a reason filter, Subscribe, Watch and settings | 649 | {viewer && ( |
| 650 | <SubscriptionBox action={`${base}/notifications`} number={issue.number} kind="issue" subscription={loaderData.subscription} /> | |
| 651 | )} | |
| Issues and pull requests replace intents and attempts | 652 | </aside> |
| 653 | </div> | |
| 654 | ); | |
| 655 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.