Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ZhangShenao/harness9
/ functions
Functions
1,385 in github.com/ZhangShenao/harness9
⨍
Functions
1,385
◇
Types & classes
252
Method
OnPreCompress
(context.Context, []schema.Message)
internal/ltm/provider.go:49
Method
OnSessionEnd
(context.Context)
internal/ltm/provider.go:50
Method
OnTurnEnd
(_ context.Context, _ int, _ bool)
internal/engine/observer.go:27
Method
OnTurnEnd
(ctx context.Context, turn int, hasTools bool)
internal/engine/agent_loop_test.go:690
Method
OnTurnStart
(ctx context.Context, _ int)
internal/engine/observer.go:26
Method
OnTurnStart
(ctx context.Context, turn int)
internal/engine/agent_loop_test.go:684
Method
Path
Path 返回计划文件的绝对路径(供测试和日志使用)。
internal/hooks/plan_writer.go:67
Method
PopMessage
PopMessage 删除并返回最新一条消息;无消息时返回 nil, nil。
internal/memory/sqlite_session.go:131
Method
PopMessage
(_ context.Context)
internal/engine/agent_loop_test.go:510
Method
Prefetch
(context.Context, string)
internal/ltm/provider.go:47
Method
ReadFile
(_ context.Context, _ string)
internal/tools/bash_test.go:220
Method
ReadFile
ReadFile 从 bind mount 的宿主机文件系统读取文件,与容器内视图一致。
internal/sandbox/docker_environment.go:47
Method
Register
Register 将工具注册到注册表中。 同名工具已存在时返回 error 且保留原实现,由调用方决定如何处理冲突 (静默忽略、终止启动、或先 unregister 再注册)。
internal/tools/registry.go:57
Method
Register
(_ tools.BaseTool)
internal/engine/compact_test.go:16
Method
Register
(_ tools.BaseTool)
internal/engine/agent_loop_test.go:79
Method
Register
(_ tools.BaseTool)
internal/engine/agent_loop_test.go:90
Method
Register
(_ tools.BaseTool)
internal/engine/agent_loop_test.go:344
Method
RunBash
(_ context.Context, cmd, _ string)
internal/tools/bash_test.go:216
Method
RunBash
RunBash 通过 docker exec 在容器内执行 bash 命令。 命令失败(非零退出)时返回 (errorString, nil),保持 Self-Correction Loopback 语义。
internal/sandbox/docker_environment.go:35
Method
SaveTodos
SaveTodos 内存实现:无操作(无持久化)。
internal/memory/mem_session.go:75
Method
SaveTodos
SaveTodos 原子性保存任务列表(write-replace 语义)。 事务内先删除该会话所有旧 todos,再全量插入新列表。
internal/memory/sqlite_session.go:213
Method
SaveTodos
(_ context.Context, items []planning.TodoItem)
internal/engine/agent_loop_test.go:522
Method
Send
Send 发送 JSON-RPC 请求并等待响应(支持 ctx 超时取消)。
internal/mcp/transport.go:156
Method
Send
(_ context.Context, method string, _ json.RawMessage)
internal/mcp/manager_test.go:31
Method
SessionID
()
internal/memory/sqlite_session.go:26
Method
SessionID
()
internal/engine/agent_loop_test.go:502
Method
Start
Start 启动容器并等待就绪:docker run → 轮询 docker inspect → StateRunning。 若 docker run 失败立即转 StateFailed;若轮询超时(StartTimeout)也转 StateFailed。
internal/sandbox/container.go:115
Method
Start
Start 启动子进程并开始读取 stdout 中的响应。
internal/mcp/transport.go:88
Method
Start
(_ context.Context)
internal/mcp/manager_test.go:18
Method
Start
(_ context.Context)
internal/mcp/client_test.go:173
Method
Sync
(context.Context, string, string)
internal/ltm/provider.go:48
Function
TestAppendPrediction
(t *testing.T)
cmd/swebench/report_test.go:53
Function
TestApprovalFnFromContext_NilWhenAbsent
(t *testing.T)
internal/hooks/decision_test.go:28
Function
TestAssemblePageUTF8SafeTruncation
(t *testing.T)
internal/tools/web_content_test.go:84
Function
TestAssertionNames
(t *testing.T)
internal/evals/assertions_test.go:133
Function
TestBashTool_Definition
(t *testing.T)
internal/tools/bash_test.go:20
Function
TestBashTool_EffectiveTimeout
TestBashTool_EffectiveTimeout 验证超时优先级:per-call > 工具配置 > 默认。
internal/tools/bash_test.go:177
Function
TestBashTool_Execute_BadJSON
(t *testing.T)
internal/tools/bash_test.go:106
Function
TestBashTool_Execute_BasicCommand
(t *testing.T)
internal/tools/bash_test.go:34
Function
TestBashTool_Execute_EmptyCommand
(t *testing.T)
internal/tools/bash_test.go:45
Function
TestBashTool_Execute_EmptyOutput
(t *testing.T)
internal/tools/bash_test.go:67
Function
TestBashTool_Execute_LargeOutput
(t *testing.T)
internal/tools/bash_test.go:78
Function
TestBashTool_Execute_NonZeroExitCode
(t *testing.T)
internal/tools/bash_test.go:56
Function
TestBashTool_Execute_ParentContextCancelled
TestBashTool_Execute_ParentContextCancelled verifies that a long-running command is killed when the parent context times out, and the result is return
internal/tools/bash_test.go:122
Function
TestBashTool_Execute_PipeCommand
(t *testing.T)
internal/tools/bash_test.go:95
Function
TestBashTool_Name
(t *testing.T)
internal/tools/bash_test.go:13
Function
TestBashTool_NilEnvironment_UsesLocal
(t *testing.T)
internal/tools/bash_test.go:241
Function
TestBashTool_PerCallTimeout
TestBashTool_PerCallTimeout 验证 timeout_secs 能放宽单次命令超时。
internal/tools/bash_test.go:164
Function
TestBashTool_TimeoutBanner
TestBashTool_TimeoutBanner 验证本地超时路径追加清晰的 TIMEOUT 横幅。
internal/tools/bash_test.go:196
Function
TestBashTool_Truncation_KeepsHeadAndTail
TestBashTool_Truncation_KeepsHeadAndTail 验证大输出同时保留头部与尾部, 不再像旧实现那样只留头部丢尾部(测试失败摘要/traceback 在尾部)。
internal/tools/bash_test.go:140
Function
TestBashTool_WithEnvironment_EmptyOutput
(t *testing.T)
internal/tools/bash_test.go:266
Function
TestBashTool_WithEnvironment_EnvError
(t *testing.T)
internal/tools/bash_test.go:279
Function
TestBashTool_WithEnvironment_LargeOutputTruncated
(t *testing.T)
internal/tools/bash_test.go:252
Function
TestBashTool_WithEnvironment_RoutesToEnv
(t *testing.T)
internal/tools/bash_test.go:225
Function
TestBuildEditSummary_CRLFContent
buildEditSummary:CRLF 文件归一化后正常展示
internal/tools/edit_file_test.go:622
Function
TestBuildEditSummary_DeletionOnly
buildEditSummary:纯删除(只删除行,无新增)
internal/tools/edit_file_test.go:517
Function
TestBuildEditSummary_InsertionOnly
buildEditSummary:纯插入(只新增行,无删除)
internal/tools/edit_file_test.go:502
Function
TestBuildEditSummary_LargeChange
buildEditSummary:变更超过 20 行时只报数字,不展开 diff
internal/tools/edit_file_test.go:532
Function
TestBuildEditSummary_SingleLineChange
buildEditSummary:单行替换,验证 - / + 行和上下文行
internal/tools/edit_file_test.go:478
Function
TestBuildInjectsLongTermMemory
(t *testing.T)
internal/context/builder_test.go:96
Function
TestBuildMentionHint
TestBuildMentionHint 验证 @ 前缀的子代理建议提示:前缀匹配、全列出、无匹配。
cmd/harness9/tui_test.go:1141
Function
TestBuildReport_PassRate
(t *testing.T)
internal/evals/report_test.go:12
Function
TestBuildSkipsEmptyLongTermMemory
(t *testing.T)
internal/context/builder_test.go:104
Function
TestBuild_BasePromptOnly
(t *testing.T)
internal/context/builder_test.go:12
Function
TestBuild_NilSkillsIndex
(t *testing.T)
internal/context/builder_test.go:87
Function
TestBuild_WithAgentsMd
(t *testing.T)
internal/context/builder_test.go:34
Function
TestBuild_WithSandboxContext
(t *testing.T)
internal/context/builder_test.go:112
Function
TestBuild_WithSkills
(t *testing.T)
internal/context/builder_test.go:52
Function
TestBuild_WithoutSandboxContext
(t *testing.T)
internal/context/builder_test.go:126
Function
TestClient_CallTool_EmptyContent
TestClient_CallTool_EmptyContent 验证空 Content 时返回空字符串且无 error。
internal/mcp/client_test.go:138
Function
TestClient_CallTool_IsError
TestClient_CallTool_IsError 验证 isError=true 时同时返回非 nil error。
internal/mcp/client_test.go:112
Function
TestClient_CallTool_Success
---- Client.CallTool 测试 ---- TestClient_CallTool_Success 验证工具调用返回文本内容正确拼接。
internal/mcp/client_test.go:85
Function
TestClient_Close_DelegatesToTransport
TestClient_Close_DelegatesToTransport 验证 Close 调用底层 Transport.Close。
internal/mcp/client_test.go:158
Function
TestClient_Connect_ContextCancelled
TestClient_Connect_ContextCancelled 验证 ctx 取消时 Connect 返回 context 错误。
internal/mcp/client_test.go:67
Function
TestClient_Connect_StartFails
TestClient_Connect_StartFails 验证 Transport.Start 失败时 Connect 返回包装错误。
internal/mcp/client_test.go:33
Function
TestClient_Connect_Success
---- Client.Connect 测试 ---- TestClient_Connect_Success 验证正常握手三步流程后 Tools 被正确填充。
internal/mcp/client_test.go:13
Function
TestClient_Connect_ToolsListParseFails
TestClient_Connect_ToolsListParseFails 验证 tools/list 返回非法 JSON 时 Connect 返回错误。
internal/mcp/client_test.go:51
Function
TestCompactInvokesExtractorBeforeSummarize
(t *testing.T)
internal/memory/summarization_test.go:430
Function
TestCompact_EmptySession
TestCompact_EmptySession 验证 session 无消息时,Compact 返回零值 CompactionData 且不报错。
internal/engine/compact_test.go:148
Function
TestCompact_NilCompactor
TestCompact_NilCompactor 验证 compactor 为 nil 时,Compact 返回零值 CompactionData 且不报错。
internal/engine/compact_test.go:46
Function
TestCompact_NilSession
TestCompact_NilSession 验证 session 为 nil 时,Compact 返回零值 CompactionData 且不报错。
internal/engine/compact_test.go:81
Function
TestCompact_Normal
TestCompact_Normal 验证正常执行:session 历史被替换为压缩后版本,CompactionData 字段正确。 与真实使用场景一致:system prompt 不持久化到 session DB, Compact 内部动态注入 system prompt 后交给 compact
internal/engine/compact_test.go:97
Function
TestContainerDockerRunArgs
(t *testing.T)
internal/sandbox/container_test.go:159
Function
TestContainerStart_DockerRunFails
(t *testing.T)
internal/sandbox/container_test.go:84
Function
TestContainerStart_InspectTimeout
(t *testing.T)
internal/sandbox/container_test.go:137
Function
TestContainerStart_Success
(t *testing.T)
internal/sandbox/container_test.go:66
Function
TestContainerStateString
(t *testing.T)
internal/sandbox/container_test.go:119
Function
TestContainerStop
(t *testing.T)
internal/sandbox/container_test.go:99
Function
TestContextCancellation
TestContextCancellation 验证 Context 取消信号的传播。
internal/engine/agent_loop_test.go:246
Function
TestContextEngineering
TestContextEngineering 运行 Context Engineering 能力评估(3 个黄金用例)。
internal/evals/dataset/context_test.go:17
Function
TestDangerHook_AfterExecute_PassThrough
(t *testing.T)
internal/hooks/danger_hook_test.go:71
Function
TestDangerHook_DangerousCommands_Ask
(t *testing.T)
internal/hooks/danger_hook_test.go:36
Function
TestDangerHook_NonBashTool_Allow
(t *testing.T)
internal/hooks/danger_hook_test.go:59
Function
TestDangerHook_SafeCommands_Allow
(t *testing.T)
internal/hooks/danger_hook_test.go:17
Function
TestDecisionConstructors
TestDecisionConstructors 验证 Allow/Deny/Ask 快捷构造函数的字段设置正确。
internal/hooks/decision_test.go:36
Function
TestDecodeUDDG
(t *testing.T)
internal/tools/web_search_test.go:58
Function
TestDefaultBootstrapCmd
TestDefaultBootstrapCmd 验证默认自举命令包含恢复 pip、editable 安装当前仓库、安装 pytest 三要素——这是"可配置·默认自举"路线让真实测试可运行的基础(接通 sandbox.BootstrapCmd 接缝)。
cmd/swebench/runner_test.go:10
Function
TestDefaultConfig_Defaults
(t *testing.T)
internal/sandbox/config_test.go:8
Function
TestDefaultConfig_DisabledWhenFalse
(t *testing.T)
internal/sandbox/config_test.go:61
Function
TestDefaultConfig_EnabledForNonFalseValues
(t *testing.T)
internal/sandbox/config_test.go:73
← previous
next →
701–800 of 1,385, ranked by callers