Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/alibaba/open-code-review
/ functions
Functions
4,468 in github.com/alibaba/open-code-review
⨍
Functions
4,468
◇
Types & classes
414
↓ 545 callers
Method
Error
()
internal/llm/retry_boundary.go:32
↓ 275 callers
Method
Run
Run executes the full-scan pipeline: enumerate → filter → token-filter → dispatch one subtask per file → collect comments.
internal/scan/agent.go:302
↓ 171 callers
Function
newProviderTUI
(cfg *Config, configPath string)
cmd/opencodereview/provider_tui.go:264
↓ 106 callers
Function
New
New creates a new SessionHistory with the given repo directory.
internal/session/history.go:150
↓ 97 callers
Method
String
String renders a one-line human-readable estimate. Money is intentionally omitted — pricing varies per provider/model and we don't want to imply a pre
internal/scan/estimate.go:108
↓ 96 callers
Method
Update
(msg tea.Msg)
cmd/opencodereview/provider_tui.go:2872
↓ 90 callers
Method
Close
()
internal/mcp/client.go:176
↓ 90 callers
Function
captureStdout
(t *testing.T, fn func())
cmd/opencodereview/output_helpers_test.go:383
↓ 85 callers
Function
ResolveEndpoint
ResolveEndpoint resolves an endpoint without per-run overrides.
internal/llm/resolver.go:83
↓ 84 callers
Function
clearAllEnv
--- Provider-based resolution tests ---
internal/llm/resolver_test.go:264
↓ 78 callers
Function
NewCommentCollector
NewCommentCollector creates an empty collector.
internal/tool/comment_collector.go:20
↓ 72 callers
Function
NewRegistry
NewRegistry creates an empty, mutable registry.
internal/tool/definitions.go:85
↓ 63 callers
Method
Add
Add appends a comment to the collector.
internal/tool/comment_collector.go:25
↓ 60 callers
Function
New
New creates a new Agent from the given arguments.
internal/agent/agent.go:207
↓ 53 callers
Function
testMeta
()
internal/llm/retry_meta_test.go:12
↓ 52 callers
Function
t
(locale: SupportedLocale, key: string)
extensions/vscode/src/shared/i18n.ts:320
↓ 50 callers
Function
setConfigValue
(cfg *Config, key, value string)
cmd/opencodereview/config_cmd.go:445
↓ 48 callers
Function
NewRetryCollector
NewRetryCollector returns an empty collector.
internal/llm/retry_report.go:267
↓ 48 callers
Function
run
({ result, stderr = "", opts = {}, githubOpts = {} })
scripts/github-actions/post-review-comments.test.js:362
↓ 47 callers
Method
Execute
Execute runs the tool with the given arguments and returns the result string.
internal/tool/definitions.go:75
↓ 47 callers
Method
Finalize
Finalize marks the session as complete, sets the end time, and persists the final summary record. When a frozen manifest was stored via SetFinalManife
internal/session/history.go:319
↓ 44 callers
Function
comment
One OCR comment as ``ocr review --format json`` emits it.
examples/gitlab_ci/post_review_test.py:40
↓ 43 callers
Method
View
()
cmd/opencodereview/provider_tui.go:3078
↓ 41 callers
Method
Get
Get returns the provider registered under name.
internal/tool/definitions.go:98
↓ 41 callers
Function
NewRunner
NewRunner returns a Runner bound to the given dependencies.
internal/llmloop/loop.go:102
↓ 41 callers
Function
NewTextMessage
NewTextMessage creates a message with simple string content.
internal/llm/client.go:81
↓ 39 callers
Function
makeTemplateWithFullScan
()
internal/scan/agent_test.go:35
↓ 38 callers
Function
Writer
Writer returns the current stdout writer (real stdout or discard).
internal/stdout/stdout.go:18
↓ 38 callers
Function
saveConfig
(path string, cfg *Config)
cmd/opencodereview/provider_cmd.go:419
↓ 37 callers
Function
NewCodeSearch
(fr *FileReader)
internal/tool/code_search.go:27
↓ 37 callers
Function
NewResolver
NewResolver builds a Resolver with the following priority: 1. Custom rule file specified via --rule flag (first match wins) 2. Project-local .opencode
internal/config/rules/system_rules.go:299
↓ 37 callers
Function
emitRunResult
emitRunResult is the post-LLM-run finalization shared by `ocr review` and `ocr scan`: resolves comment line numbers, records telemetry, restores stdou
cmd/opencodereview/shared.go:642
↓ 37 callers
Function
enterKey
()
cmd/opencodereview/provider_tui_test.go:22
↓ 36 callers
Method
Run
Run executes the full review pipeline: parse diffs -> plan per file -> LLM tool-loop -> collect comments.
internal/agent/agent.go:278
↓ 35 callers
Function
loadOrCreateConfig
(path string)
cmd/opencodereview/config_cmd.go:386
↓ 33 callers
Method
Freeze
Freeze prevents further mutations. Call once setup is complete.
internal/tool/definitions.go:104
↓ 33 callers
Function
NewAgent
NewAgent creates a scan Agent from the given args. The Session is auto-created (review_mode = full_scan) when not supplied.
internal/scan/agent.go:119
↓ 32 callers
Method
Register
Register adds a tool provider. Panics if the registry is frozen.
internal/tool/definitions.go:90
↓ 31 callers
Function
New
New creates a Runner that allows at most maxConcurrent simultaneous git subprocesses. If maxConcurrent <= 0 the default (16) is used.
internal/gitcmd/runner.go:25
↓ 30 callers
Method
GetOrCreateFileSession
GetOrCreateFileSession returns the FileSession for the given file path, creating one if it doesn't exist yet.
internal/session/history.go:235
↓ 30 callers
Function
setupTestRepo
(t *testing.T)
internal/tool/code_search_test.go:104
↓ 29 callers
Function
initTestGitRepo
(t *testing.T)
cmd/opencodereview/git_test.go:14
↓ 29 callers
Method
models
()
cmd/opencodereview/provider_tui.go:526
↓ 29 callers
Function
setupEnabledTelemetry
(t *testing.T)
internal/telemetry/events_test.go:26
↓ 28 callers
Method
Freeze
Freeze builds the immutable report. It must be called once, after the run is done, and runID is the review session ID. The three return shapes are di
internal/llm/retry_report.go:476
↓ 28 callers
Function
LookupProvider
LookupProvider returns the preset provider by name. The returned Provider has its own copy of the Models slice.
internal/llm/providers.go:497
↓ 28 callers
Function
ResolveLineNumbers
ResolveLineNumbers populates StartLine/EndLine on each comment by matching the ExistingCode against the corresponding file's diff hunks (primary), or
internal/diff/resolver.go:15
↓ 28 callers
Function
newBuilderWith
newBuilderWith registers a set of selected items on a fresh builder and sets a valid input mode so Finalize passes the mandatory-mode check.
internal/session/manifest_test.go:22
↓ 28 callers
Function
writeJSONL
(t *testing.T, path string, lines ...string)
internal/viewer/store_test.go:13
↓ 27 callers
Method
MarkCompleted
MarkCompleted records that the item's subtask completed. Whether it produced comments does not affect completion.
internal/session/manifest.go:691
↓ 27 callers
Function
mustFinalize
mustFinalize finalizes and fails the test on an unexpected validation error.
internal/session/manifest_test.go:34
↓ 26 callers
Method
Name
()
internal/mcp/client.go:154
↓ 26 callers
Function
setMCPServerValue
(cfg *Config, key, value string)
cmd/opencodereview/config_cmd.go:828
↓ 25 callers
Method
Err
Err returns the first error encountered while creating or writing the underlying file, or nil if none occurred. Text-mode rendering drops the per-writ
cmd/opencodereview/shared.go:539
↓ 25 callers
Function
NewOpenAIClient
NewOpenAIClient creates a new OpenAI-compatible LLM client. ExtraHeaders are applied per request (not baked into the SDK client) so SessionKeyTemplate
internal/llm/client.go:389
↓ 25 callers
Method
dispatchSubtasks
dispatchSubtasks runs the Plan + Main phases for each changed file concurrently.
internal/agent/agent.go:587
↓ 25 callers
Function
parseReviewFlags
parseReviewFlags provides test compatibility: parses args through a fresh cobra command instance and returns the resulting reviewOptions.
cmd/opencodereview/compat_test.go:18
↓ 25 callers
Function
setTestHome
setTestHome redirects the user home resolved by os.UserHomeDir() to dir for the duration of the test. Setting HOME alone is NOT enough on Windows: os.
cmd/opencodereview/delegate_exec_test.go:87
↓ 24 callers
Method
Comments
Comments returns all collected comments.
internal/tool/comment_collector.go:32
↓ 24 callers
Function
dKey
--- Delete custom provider tests ---
cmd/opencodereview/provider_tui_test.go:1138
↓ 24 callers
Method
result
()
cmd/opencodereview/provider_tui.go:1963
↓ 24 callers
Function
setTestHome
setTestHome redirects the user home resolved by os.UserHomeDir() to dir for the duration of the test. Setting HOME alone is NOT enough on Windows: os.
internal/session/test_home_test.go:13
↓ 24 callers
Function
setTestHome
setTestHome redirects the user home resolved by os.UserHomeDir() to dir for the duration of the test. Setting HOME alone is NOT enough on Windows: os.
internal/config/rules/test_home_test.go:13
↓ 23 callers
Method
Write
(p []byte)
internal/llm/keycmd.go:42
↓ 23 callers
Function
metaCtx
metaCtx attaches identity the way the review path will in P4.
internal/llm/retry_observer_test.go:67
↓ 23 callers
Function
msg
(role, text string)
internal/llmloop/compression_test.go:13
↓ 23 callers
Function
useT
()
extensions/vscode/src/webview/I18nProvider.tsx:10
↓ 22 callers
Method
Content
Content extracts the text content from the first choice, falling back to reasoning content.
internal/llm/client.go:169
↓ 22 callers
Method
RecordReviewItemDone
RecordReviewItemDone persists the file-level checkpoint used by resume.
internal/session/history.go:252
↓ 22 callers
Method
RunPerFile
RunPerFile drives the main LLM conversation loop for a single file. It sends messages with the configured tool definitions, executes any tool calls re
internal/llmloop/loop.go:286
↓ 22 callers
Function
StartSpan
StartSpan creates a new span from the given context. When telemetry is not enabled, it returns a no-op span so callers can safely defer .End().
internal/telemetry/span.go:25
↓ 22 callers
Method
loadExistingAPIKey
()
cmd/opencodereview/provider_tui.go:1929
↓ 22 callers
Function
makeGithub
(opts = {})
scripts/github-actions/post-review-comments.test.js:102
↓ 21 callers
Method
CompletionsWithCtx
CompletionsWithCtx sends a chat completion request with context support for cancellation and timeout. The deferred finalizeRequest is the client boun
internal/llm/client.go:440
↓ 21 callers
Method
ExtractText
ExtractText returns the concatenated text content from a Message's Content field. Handles both plain string and content block array formats.
internal/llm/client.go:107
↓ 21 callers
Method
Item
Item returns a copy of the checkpoint for fingerprint.
internal/session/resume.go:219
↓ 21 callers
Function
NewOpenAIResponsesClient
NewOpenAIResponsesClient creates a client for the OpenAI Responses API. URL normalization mirrors NewOpenAIClient: cfg.URL is forced to end in respons
internal/llm/responses_client.go:35
↓ 21 callers
Function
ping
(ctx context.Context, client LLMClient)
internal/llm/retry_observer_test.go:59
↓ 21 callers
Function
run_publish
Helper: run publish() with a Recorder and no-op sleep.
examples/gitlab_ci/post_review_test.py:205
↓ 20 callers
Function
ListProviders
ListProviders returns all built-in providers sorted by provider name. Each returned Provider has its own copy of the Models slice in registry order.
internal/llm/providers.go:507
↓ 20 callers
Method
gitGrep
(ctx context.Context, searchText string, caseSensitive bool, usePerlRegexp bool, pathspec []string)
internal/tool/code_search.go:136
↓ 20 callers
Function
truncate
(s string, maxLen int)
internal/config/rules/system_rules_test.go:254
↓ 19 callers
Method
call
Drive a poster method over a sequence of fake urlopen outcomes.
examples/gitlab_ci/post_review_test.py:771
↓ 19 callers
Function
comment
One OCR comment as `ocr review --format json` emits it.
examples/gerrit_ci/post_review_test.py:31
↓ 19 callers
Function
parseScanFlags
parseScanFlags provides test compatibility: parses args through a fresh cobra command instance and returns the resulting scanOptions.
cmd/opencodereview/compat_test.go:46
↓ 19 callers
Function
recordUntimed
recordUntimed records an attempt with zero timestamps. These tests are about numbering, outcome and aggregation, where the derived durations are nois
internal/llm/retry_report_test.go:26
↓ 19 callers
Method
run_main
(self, argv=(), env=BASE_ENV, result=SAMPLE_RESULT, outcomes=None, input_args=None)
examples/gerrit_ci/post_review_test.py:304
↓ 19 callers
Function
stripANSI
stripANSI removes ANSI escape sequences from a string so tests can assert against plain text content.
cmd/opencodereview/provider_tui_test.go:2613
↓ 18 callers
Method
CompletionsWithCtx
(ctx context.Context, req ChatRequest)
internal/llm/client.go:55
↓ 18 callers
Function
NewAnthropicClient
NewAnthropicClient creates a new Anthropic Messages API client. The Anthropic API manages prompt-cache affinity server-side, so unlike the OpenAI clie
internal/llm/client.go:777
↓ 18 callers
Method
Resolve
(path string)
internal/config/rules/system_rules.go:22
↓ 18 callers
Method
Since
Since returns a copy of all comments stored at index ≥ start. Returns nil when no new comments have been added since the snapshot.
internal/tool/comment_collector.go:64
↓ 18 callers
Method
Write
(p []byte)
cmd/opencodereview/shared.go:386
↓ 18 callers
Function
attemptsFor
Every test below reaches Freeze without finalizing anything itself: the client boundary in CompletionsWithCtx does it. That is deliberate — Freeze ref
internal/llm/retry_observer_test.go:48
↓ 18 callers
Function
resolveRuleEntries
resolveRuleEntries scans each entry's Rule field. When the value looks like a file path, it reads the file content and replaces the Rule. Absolute pat
internal/config/rules/system_rules.go:560
↓ 17 callers
Method
AppendTaskRecord
AppendTaskRecord adds a new task record to the file session for the given file path and task type. It auto-assigns the RequestNo based on existing rec
internal/session/history.go:352
↓ 17 callers
Method
CompletedCount
CompletedCount returns the number of file-level checkpoints replay recovered. Review reuse is narrower — see ReusableItem — while scan, having no mani
internal/session/resume.go:211
↓ 17 callers
Method
Finalize
Finalize decides the request-level outcome for m exactly once. The three inputs are the recorded attempts, the error the logical request returned to
internal/llm/retry_report.go:432
↓ 17 callers
Function
ModelListContains
ModelListContains reports whether target matches any entry in models (trimmed).
internal/llm/resolver.go:810
↓ 17 callers
Method
ReadLines
ReadLines returns a window of lines from the file plus the total line count. startLine is 1-based; maxLines is the maximum number of lines to collect.
internal/tool/filereader.go:142
next →
1–100 of 4,468, ranked by callers