feat(adapters/linear): typed proactive session creation + repository suggestions, with worked capability examples - #52
Conversation
…uggestions, and worked capability examples - CreateSessionOnIssue / CreateSessionOnComment (+ ForTenant variants) wrap agentSessionCreateOnIssue / agentSessionCreateOnComment and return a CreatedAgentSession whose opaque ThreadID posts like any webhook-minted agent-session thread (#47). - SuggestRepositories wraps issueRepositorySuggestions with typed candidates and confidence-scored results, sending agentSessionId only on agent-session threads (#48). - Worked capability loops (auth/select elicitations with follow-up handling, externalUrls updates, stop confirmation, proactive sessions, repository suggestions) in docs/how-to/linear-agent-sessions.md, extracted from the buildable, tested examples/linear-agent-hello-world/capabilities.go and kept in sync by a documentation drift test (#49). Closes #47, closes #48, closes #49.
|
@codex review |
|
@codex security review |
|
@codex review |
|
@codex security review |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e95dbb444b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…e; host-qualify repository options Addresses codex review findings on #52: - A follow-up is interpreted as a select answer only while an elicitation is actually pending on that thread, via a take-once per-thread registry (take-once matches Linear dismissing the elicitation on free-text replies). - Select option values/labels are qualified with the Git host so same-named repositories on different hosts stay distinguishable.
|
@codex review |
|
@codex security review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3de21f44da
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…itory options as pending Addresses round-2 codex review findings on #52: - A confirmed stop abandons the thread's pending selection so a later message is not misread as a choice; follow-up routing is extracted into newFollowUpHandler and covered by a test. - offerRepositoryChoice records the offered (host-qualified) option values as the thread's pending selection, matching the deploy loop's pattern.
|
@codex review |
|
@codex security review |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84344a21da
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ed post, live handle on thought failure Addresses round-3 codex review findings on #52: - pendingSelection carries the elicitation kind so a repository choice is routed to repository handling instead of the deploy acknowledgement. - A matched choice whose acknowledgement fails to post is re-registered (DispatchDeferred only observes handler errors), while free-text replies still consume the elicitation. - startProactiveSession returns the created ThreadID with the error when the first thought fails, so the live session can be retried or ended instead of leaked or duplicated.
|
@codex review |
|
@codex security review |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Delivers the Linear capabilities work package (#47 + #48 + #49) as one coherent PR: typed helpers for the two remaining preview operations that previously required the
GraphQLescape hatch, plus worked end-to-end examples that exercise them.#47 — Typed proactive agent session creation
CreateSessionOnIssue/CreateSessionOnCommentwrapagentSessionCreateOnIssue/agentSessionCreateOnComment(verified against Linear's published SDL) and return aCreatedAgentSessionwhose opaqueThreadIDworks everywhere a webhook-minted one does —chat.Chat.Thread,Thread.Post,PostThought,UpdateSession, ….ENG-123-style alias), andexternalUrlscan be seeded at creation to satisfy the first-thought window (ADR 0008).CreateSessionOnIssueForTenant/CreateSessionOnCommentForTenantresolve per-org tokens through the InstallStore (ADR 0006); proactive creation has no inbound webhook to infer the tenant from, so the single-install entry points reject multi-tenant mode, and the single-installForTenantform fails fast on an organization mismatch.#48 — Typed repository suggestions
SuggestRepositories(ctx, threadID, []CandidateRepository)wrapsissueRepositorySuggestionswith the typed candidate input shape (hostname,repositoryFullName) and returnsRepositorySuggestionvalues with confidence scores.agentSessionIdis sent only for agent-session threads (it is a nullable variable upstream).Both helpers reuse the adapter's existing GraphQL client, bounded rate-limit retry (ADR 0005), and per-tenant token resolution (ADR 0006). Additive public API only — Linear stays experimental-tier and the docs say so.
#49 — Worked capability examples
docs/how-to/linear-agent-sessions.mdgains full interaction loops: auth elicitation (including the resume-after-linking follow-up, which Linear does not webhook), select elicitation with human-response handling (option value vs. free text),externalUrlssession updates, stop handling with the confirm-response contract, proactive session creation, and repository suggestions paired with a low-confidenceselectelicitation.examples/linear-agent-hello-world/capabilities.go; a new documentation test (TestLinearHowToSnippetsAreExtractedFromBuildableSource) fails on doc/code drift via<!-- source: … -->markers.OnSubscribedMessagehandler; each helper has unit tests against a recording fake.docs/linear-agent-capabilities.mdmoves gaps docs: clarify Chat SDK Go positioning #1/Add Linear app-actor adapter #2/feat(adapters/msteams): land Microsoft Teams adapter as experimental (needs live-tenant validation) #6 to Supported and points the stop-serialization gap at the new worked pattern; the adapter GoDoc surface list is updated to match.Tests
Thread.PostandPostThought), input/variable assertions, error paths (success=false, missing issue, GraphQL errors array, pre-API validation), rate-limit retry via a shared throttle knob, and multi-tenant variants proving per-org bearer tokens plus clean install-lookup failures.Validation
mise run vet— clean across all workspace modules.GOFLAGS=-race mise run test— all modulesok(root, adapters, state/nats, state/postgres, state/redis, examples).go build ./...inexamples/linear-agent-hello-world— clean.Closes #47
Closes #48
Closes #49
Generated with
mux• Model:anthropic:claude-fable-5• Thinking:xhigh