Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/alibaba/open-code-review
/ functions
Functions
4,075 in github.com/alibaba/open-code-review
⨍
Functions
4,075
◇
Types & classes
386
↓ 4 callers
Method
maybeRunPlan
maybeRunPlan invokes PLAN_TASK on the file and returns a human-readable guidance string suitable for {{plan_guidance}} substitution. Returns "(no pre-
internal/scan/agent.go:754
↓ 4 callers
Method
modelProviderName
()
cmd/opencodereview/provider_tui.go:397
↓ 4 callers
Function
mustGetResult
mustGetResult extracts the first result from a SARIF document, failing the test if the structure is wrong.
cmd/opencodereview/sarif_test.go:34
↓ 4 callers
Function
nKey
()
cmd/opencodereview/provider_tui_test.go:1146
↓ 4 callers
Function
newCompressionRunner
newCompressionRunner returns a Runner whose template forces runCompression to issue a request, plus the message slice to feed it.
internal/llmloop/retry_identity_test.go:173
↓ 4 callers
Function
newMockResponse
(content string)
internal/diff/relocation_test.go:27
↓ 4 callers
Function
normalizeLine
normalizeLine removes leading/trailing whitespace and strips any leading '+' or '-' diff marker.
internal/diff/resolver.go:235
↓ 4 callers
Function
openAIClient
The four blind spots share one shape: the observer sees HTTP 200, the failure surfaces afterwards, and nothing downstream would notice the omission —
internal/llm/retry_boundary_test.go:27
↓ 4 callers
Function
outputJSONWithWarnings
(comments []model.LlmComment, warnings []agent.AgentWarning, filesReviewed, inputTokens, outputTokens, totalT
cmd/opencodereview/output.go:316
↓ 4 callers
Function
outputPreviewText
(p *agent.DiffPreview)
cmd/opencodereview/output.go:579
↓ 4 callers
Function
outputTextWithWarnings
(comments []model.LlmComment, warnings []agent.AgentWarning, manifest *session.RunManifest)
cmd/opencodereview/output.go:66
↓ 4 callers
Function
parseNameStatus
(output: string)
extensions/vscode/src/extension/services/gitMap.ts:161
↓ 4 callers
Function
parseNonNegInt
(val, defaultVal)
scripts/github-actions/post-review-comments.js:1064
↓ 4 callers
Function
partitionMessages
partitionMessages divides messages into frozen, compress, and active zones. Frozen zone is always messages[0:2]. Active zone preserves the K most rece
internal/llmloop/compression.go:126
↓ 4 callers
Method
post
(msg: ConfigPanelHostToWebview)
extensions/vscode/src/extension/providers/ConfigPanelProvider.ts:61
↓ 4 callers
Method
post_discussion
(self, discussion, comment_id=None)
examples/gitlab_ci/post_review_test.py:186
↓ 4 callers
Function
printVersion
()
cmd/opencodereview/version.go:28
↓ 4 callers
Method
read
(self)
examples/gerrit_ci/post_review_test.py:514
↓ 4 callers
Function
readAllPages
(tag, pageFn, log, maxPages = 50)
scripts/github-actions/post-review-comments.js:1230
↓ 4 callers
Function
readJSONLRecords
(t *testing.T, path string)
internal/session/persist_test.go:113
↓ 4 callers
Method
release
()
internal/gitcmd/runner.go:44
↓ 4 callers
Method
reloadConfigAfterSaveFailure
reloadConfigAfterSaveFailure reloads on-disk config and refreshes derived provider TUI state so the UI matches persisted data after a failed save. Ret
cmd/opencodereview/provider_tui.go:1586
↓ 4 callers
Method
reloadConfigAfterSaveFailure
reloadConfigAfterSaveFailure reloads on-disk config so in-memory state matches persisted data after a failed save. Returns false when reload could not
cmd/opencodereview/provider_tui.go:2600
↓ 4 callers
Function
renderListName
(name string, isCursor bool)
cmd/opencodereview/provider_tui.go:1956
↓ 4 callers
Function
resolveBackgroundFilePath
(repoDir, path string)
cmd/opencodereview/background_file.go:25
↓ 4 callers
Function
resolveRepoDir
resolveRepoDir resolves the repo dir for `ocr rules check`. It delegates to resolveWorkingDir(requireGit=true) so it anchors at the git top-level just
cmd/opencodereview/review_cmd.go:434
↓ 4 callers
Function
resolveWorkingDirForSession
resolveWorkingDirForSession accepts an explicit --repo flag value and falls back to the current working directory. Unlike resolveRepoDir it does not r
cmd/opencodereview/session_cmd.go:245
↓ 4 callers
Method
resolvedModel
resolvedModel returns the model to persist, falling back to the in-session pick for the provider being finalized when result.model is empty.
cmd/opencodereview/provider_tui.go:88
↓ 4 callers
Method
reviewMode
()
internal/agent/agent.go:812
↓ 4 callers
Function
reviewModeString
(from, to, commit string)
internal/agent/util.go:92
↓ 4 callers
Function
reviseAttempt
reviseAttempt applies a client-boundary correction to the last attempt of the logical request identified by ctx. Requests without identity (scan, llm
internal/llm/retry_boundary.go:102
↓ 4 callers
Function
rollbackCfgActiveModel
(cfg *Config, providerName, prevModel string)
cmd/opencodereview/provider_tui.go:448
↓ 4 callers
Method
ruleConfigSHA256
ruleConfigSHA256 is the deterministic identity of the resolved rule configuration this run operates with: the resolver's effective rule-text layers (c
internal/agent/agent.go:943
↓ 4 callers
Function
runConfigSet
(key, value string)
cmd/opencodereview/config_cmd.go:109
↓ 4 callers
Function
runLLMTest
()
cmd/opencodereview/llm_cmd.go:53
↓ 4 callers
Function
runPreview
(cc *commonContext, opts reviewOptions)
cmd/opencodereview/review_cmd.go:481
↓ 4 callers
Function
runScanPreview
(cc *commonContext, scanTpl *template.ScanTemplate, scanPaths []string, outputFormat string)
cmd/opencodereview/scan_cmd.go:254
↓ 4 callers
Method
run_main_with_captured_poster
(self, env_overrides, result=None)
examples/gitlab_ci/post_review_test.py:1515
↓ 4 callers
Method
run_with_urlopen
(self, fake_urlopen, config=None, discussion=None)
examples/gitlab_ci/post_review_test.py:1090
↓ 4 callers
Function
sarifInvocationFromRun
sarifInvocationFromRun builds the run.invocations entry from the manifest's terminal state and any warnings collected during the review. executionSuc
cmd/opencodereview/sarif.go:314
↓ 4 callers
Function
sarifResultFromComment
sarifResultFromComment maps a single LlmComment to a SARIF result. Field mapping follows FR-3 in the requirements spec: - Path → locations[].
cmd/opencodereview/sarif.go:228
↓ 4 callers
Method
selectedModel
()
cmd/opencodereview/provider_tui.go:2893
↓ 4 callers
Method
selectedModelFromState
()
cmd/opencodereview/provider_tui.go:1829
↓ 4 callers
Function
sessionJSONLPath
(t *testing.T, repoDir, sessionID string)
internal/session/persist_test.go:133
↓ 4 callers
Function
setupFileFindRepo
(t *testing.T)
internal/tool/file_find_test.go:92
↓ 4 callers
Method
sourceArtifactSHA256
sourceArtifactSHA256 is the deterministic content identity of this run's selected input: for every non-deleted diff (the same set registerCoverage sea
internal/agent/agent.go:911
↓ 4 callers
Method
summaryEnabled
()
internal/scan/agent.go:92
↓ 4 callers
Function
taskDoneResponseWithArguments
(arguments string)
internal/llmloop/loop_test.go:41
↓ 4 callers
Method
transition
transition moves a selected item to a terminal state through the single coverage entry point. Unknown item_id, an invalid failed classification, an em
internal/session/manifest.go:559
↓ 4 callers
Method
triggerAsyncCompression
triggerAsyncCompression kicks off a background compression job for the conversation owning st. A no-op when a job is already pending — the check-and-s
internal/llmloop/compression.go:291
↓ 4 callers
Function
unquoteGitPath
(path: string)
extensions/vscode/src/extension/services/gitMap.ts:130
↓ 4 callers
Method
updateManualForm
(key string, msg tea.KeyPressMsg)
cmd/opencodereview/provider_tui.go:1356
↓ 4 callers
Function
useSectionTitleStyle
()
pages/src/hooks/useResponsiveStyle.ts:15
↓ 4 callers
Function
userAgent
(provider string)
internal/llm/client.go:32
↓ 4 callers
Method
valid
valid reports whether c is one of the fixed attempt error classes.
internal/llm/retry_report.go:38
↓ 4 callers
Method
valid
valid reports whether c is one of the fixed item failure classes.
internal/session/manifest.go:67
↓ 4 callers
Function
validateTimeoutSec
validateTimeoutSec converts a config-file timeout (in seconds) to time.Duration. Returns 0 for zero input (use default). Rejects negative values and o
internal/llm/resolver.go:174
↓ 4 callers
Function
writeCommit
writeCommit writes content to name, stages it, and commits with msg.
internal/diff/git_resolve_test.go:41
↓ 3 callers
Method
CallTool
CallTool invokes a tool on the MCP server and returns the text result.
internal/mcp/client.go:158
↓ 3 callers
Method
CollectPendingComments
CollectPendingComments awaits any async comment-processing workers and returns the aggregated comments from the collector. Safe to call once per sessi
internal/llmloop/loop.go:192
↓ 3 callers
Method
CompletionsWithCtx
CompletionsWithCtx sends a Responses API request and maps the result back to the shared ChatResponse shape. The deferred finalizeRequest is this clie
internal/llm/responses_client.go:89
↓ 3 callers
Function
ComputeLineDiff
ComputeLineDiff returns a line-level diff between oldLines and newLines. Uses Myers-style LCS to find common subsequences, then emits context/added/de
internal/suggestdiff/diff.go:27
↓ 3 callers
Function
ContentLogging
ContentLogging returns true when content logging is enabled via OCR_CONTENT_LOGGING.
internal/telemetry/provider.go:78
↓ 3 callers
Function
DisplayAddr
DisplayAddr rewrites a wildcard listen address (empty host, 0.0.0.0, or ::) to a localhost form so printed URLs are always openable in a browser. Non-
internal/viewer/hostguard.go:122
↓ 3 callers
Method
FinalManifest
FinalManifest returns the frozen manifest stored for this run, or nil when the run produced none (legacy/scan, or a construction failure).
internal/session/history.go:208
↓ 3 callers
Method
Get
Get returns the diff text for path.
internal/tool/file_read_diff.go:27
↓ 3 callers
Function
ListSessions
ListSessions returns lightweight summaries for all sessions in a repo subdir.
internal/viewer/store.go:111
↓ 3 callers
Method
MergeBase
MergeBase returns the computed merge-base commit hash for range mode.
internal/diff/git.go:164
↓ 3 callers
Function
NewClient
NewClient starts an MCP server subprocess (stdio transport), initializes the connection, and caches the list of available tools. The context governs t
internal/mcp/client.go:30
↓ 3 callers
Function
NewCommentWorkerPool
NewCommentWorkerPool delegates to llmloop.NewCommentWorkerPool.
internal/agent/agent.go:49
↓ 3 callers
Function
NewToolCallMessage
NewToolCallMessage creates an assistant message with text content and tool invocations.
internal/llm/client.go:73
↓ 3 callers
Function
Of
Of returns a checkpoint with data.
internal/tool/response_message.go:27
↓ 3 callers
Function
ParseRetryCodes
ParseRetryCodes parses a comma-separated list of HTTP status codes that should trigger retry. Non-4xx codes return an error; SDK-default codes (408, 4
internal/llm/resolver.go:770
↓ 3 callers
Function
ParseReviewMode
ParseReviewMode returns the correct ReviewMode based on provided flag values.
internal/tool/filereader.go:34
↓ 3 callers
Function
PrintToolCallStarted
PrintToolCallStarted prints a line when a tool begins execution. Args are summarized as key-value pairs (path, search terms, etc.). Example: [ocr] ▶
internal/telemetry/events.go:90
↓ 3 callers
Function
Quiet
Quiet replaces stdout with io.Discard and returns a cleanup function. Usage: defer stdout.Quiet()() WARNING: Quiet must ONLY be called from the mai
internal/stdout/stdout.go:33
↓ 3 callers
Function
RecordLLMRequest
(ctx context.Context, model string, dur time.Duration, totalTokens int64, status string)
internal/telemetry/metrics.go:107
↓ 3 callers
Method
RecordResumeLineage
RecordResumeLineage persists the run's single resume_lineage event. A nil lineage is a non-resumed run and writes nothing.
internal/session/history.go:285
↓ 3 callers
Function
RecordToolCall
(ctx context.Context, name string, dur time.Duration, ok bool)
internal/telemetry/metrics.go:127
↓ 3 callers
Method
RemoveByPathAndIndices
RemoveByPathAndIndices removes comments for a given path whose per-path index (0-based position among all comments with that path) is in the indices s
internal/tool/comment_collector.go:96
↓ 3 callers
Method
Resolve
Resolve returns the rule text for a given file path. Patterns with brace expansion like "*.{go,py}" are expanded into "*.go", "*.py". The first match
internal/config/rules/system_rules.go:130
↓ 3 callers
Function
ResolveConfig
ResolveConfig builds the final Config by merging defaults, JSON config, and env vars. Precedence: defaults < config.json < environment variables.
internal/telemetry/config.go:113
↓ 3 callers
Method
ReusableItem
ReusableItem returns the checkpoint for fingerprint only if the parent manifest also recorded that fingerprint as completed or reused. The manifest i
internal/session/resume.go:240
↓ 3 callers
Method
Session
Session returns the session history associated with this Agent.
internal/scan/agent.go:172
↓ 3 callers
Method
SessionID
SessionID returns the current review's resumable session ID. It returns an empty string when the session file could not be created, so callers do not
internal/agent/agent.go:411
↓ 3 callers
Function
SessionsRoot
SessionsRoot returns the root directory where session JSONL files are stored.
internal/viewer/store.go:25
↓ 3 callers
Method
SetDiffMap
SetDiffMap replaces the diff snapshot. Must be called before concurrent access begins.
internal/tool/file_read_diff.go:42
↓ 3 callers
Function
ShutdownWithTimeout
ShutdownWithTimeout creates a timeout context and calls Shutdown.
internal/telemetry/shutdown.go:36
↓ 3 callers
Method
Snapshot
Snapshot returns the current count of stored comments. Pair with Since / ReplaceSince to operate on the comments added between two points in time (e.g
internal/tool/comment_collector.go:56
↓ 3 callers
Function
StartServer
(addr string)
internal/viewer/server.go:20
↓ 3 callers
Method
SubmitFor
SubmitFor is Submit plus registration under key, so AwaitKey can wait for exactly the units submitted under that key instead of the whole pool. Calle
internal/llmloop/pool.go:74
↓ 3 callers
Method
TotalOutputTokens
TotalOutputTokens returns the accumulated completion tokens from all LLM calls.
internal/llmloop/loop.go:122
↓ 3 callers
Method
TotalTokensUsed
TotalTokensUsed / TotalInputTokens / ... delegate to the underlying runner.
internal/scan/agent.go:212
↓ 3 callers
Method
WaitBackground
WaitBackground blocks until every background job started by this Runner has returned. Background memory compression is the only such job, and cancelPe
internal/llmloop/loop.go:114
↓ 3 callers
Method
_mock_response
(self, status=200, body=b'{"comment_biz_id": "abc"}')
examples/codeup_ci/post_review_test.py:138
↓ 3 callers
Function
_num
(v)
examples/gitlab_ci/post_review.py:404
↓ 3 callers
Method
_poster
(self, config_overrides=None)
examples/gitlab_ci/post_review_test.py:1032
↓ 3 callers
Method
_read_with_pacing
Read with proactive pacing, mirroring the GitHub Action's readWithPacing. Reads are cheaper than writes but still consume the primary rate li
examples/gitlab_ci/post_review.py:828
↓ 3 callers
Function
addExcludeFlag
(cmd *cobra.Command, target *string)
cmd/opencodereview/shared_flags.go:39
↓ 3 callers
Function
addOutputFlags
(cmd *cobra.Command, format, audience *string)
cmd/opencodereview/shared_flags.go:32
← previous
next →
501–600 of 4,075, ranked by callers