| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
test: address review findings for browser.Open scheme validation - Replace misleading custom contains helper with strings.Contains (P1) - Add TestOpenRejectsBadScheme to verify Open() enforces validation (P1) - Add TestValidateURLSchemeParseError for url.Parse error branch (P1) - Add boundary cases: userinfo, localhost, IPv6, mailto, protocol-relative, leading space, control char, null byte, scheme with space - Add scheme name assertion to error message test Refs #358 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 3 个月前 | |
fix(review): pin success-state JSON and tighten always-present wording - add the success-path --json test (token_valid:true plus username, token_source, git_protocol), closing the three-state coverage of the always-serialized state booleans the test review flagged - docs/COMMANDS.md: the failure sentence now states both fields always serialize, per the docs review suggestion, so agent consumers know they can skip field-presence branching Refs #624 Co-Authored-By: Claude Code <noreply@anthropic.com> | 7 天前 | |
fix(test): make factory branch test independent of CI detached-HEAD checkout TestNewFactoryBranchInsideGitRepo relied on the working checkout having a resolvable current branch. PR checkouts run from a detached HEAD, so the test failed on every CI platform (GitCode Test job, GitHub ubuntu/macos/windows) and blocks all PRs since it landed on main. Verified locally with git checkout --detach. The test now builds a temporary repository with one commit checked out on a fixed branch name, following the existing initDetachedGitRepo pattern in the same file. Unrelated to the env-token guidance work; included here to unblock this PR's CI, split as its own commit. Co-Authored-By: Claude Code <noreply@anthropic.com> | 8 天前 | |
fix(config,installupdate): read the configured update mode without env masking The invalid-GC_UPDATE_MODE fallback added in the third round never worked in production: configUpdateMode read the configured value through cfg.Get, which honors GC_UPDATE_MODE first and returns the (possibly invalid) environment text verbatim — so the fallback branch was dead whenever the environment variable was set, and GC_UPDATE_MODE=banana overrode a configured "off" (the Go side kept spawning the helper daily while the JS side correctly reported off, producing one wasted registry request per day and a ghost "Automatic updates are disabled." notice per cycle). Add config.FileGet — the same lookup as Get minus the environment override, on the concrete type rather than the public Config interface (adding interface methods breaks external implementers) — and consume it in configUpdateMode through a type assertion with a Get fallback. The unit tests missed this because they fed resolveUpdateMode directly instead of going through a real config; the new tests exercise the real factory with a config file, an invalid env value, and both override directions. Fourth review batch 1, issue 604 item 3. Co-Authored-By: Claude Code <noreply@anthropic.com> | 29 天前 | |
fix(doctor): install diagnostics parity and guards Seven round-6 findings in the doctor install path: - Empty binary guard: DetectDistribution with an empty binary path read .gitcode-install.json from the current working directory (filepath.Dir of "" is "."), so running doctor from an npm package root could misreport the channel. It now short-circuits to the documented archive-or-source default. - JSON contract: commands.<name>.candidates serialized as null when nothing was found — the not-on-PATH case is doctor's main diagnostic path. commandCandidates now returns a non-nil slice. - PATHEXT parity: the Windows extension probe used a hardcoded order (.exe before .com) that contradicts cmd.exe's documented PATHEXT resolution. Both sides now expand the user's PATHEXT (fallback .com/.exe/.bat/.cmd), always append .ps1 (npm writes ps1 shims on every install), and keep the extensionless form last so Git Bash sh shims stay visible. - Symlink parity: distribution detection resolved symlinks before reading the adjacent manifest, but the bootstrap on-PATH check read the manifest next to the unresolved path — a symlinked invocation reported the channel from the resolved manifest while silently skipping the on-PATH diagnostic. Inspect now resolves once and feeds both consumers (Report.Binary keeps the invoked path). - Human output: doctor install --json always carried version/commit/ built and COMMANDS.md documents them, but the human output omitted all three; they now lead the report ((not found) placeholders when the build metadata is empty). - JS pathEntries split PATH on every separator, including inside quotes — a legal "C:\tools;a" entry produced phantom candidates and disagreed with the Go side (filepath.SplitList is quote-aware). It now mirrors the Go semantics. - Tests: the npm-prefix conflict branch (both outcomes, both goos variants — single-entry PATHs because SplitList is host-aware), the candidates-are-arrays JSON contract, the human version header, the symlinked-bootstrap on-PATH check, and the CWD-manifest guard; the JS side locks the quote-aware split and the PATHEXT expansion. Co-Authored-By: Claude Code <noreply@anthropic.com> | 27 天前 | |
merge: resolve conflicts between feature/issue-404 and main Resolve merge conflicts in 4 files by adopting main's cleaner implementation while preserving PR branch's more comprehensive test coverage (flag registration test, TTY-based CanPrompt tests, nil-safe CanPrompt test). | 3 个月前 | |
test(lark): cross-platform stubs for CI (fix #499) lark 测试硬编码 /bin/true 作 FindLarkCLI 桩,该路径仅 Linux 存在,导致 macOS/Windows CI 报 lark-cli not installed(4 测试跨平台失败,main HEAD 既有)。改用 os.Executable() (运行中的测试二进制,全平台存在且 isExecutable 通过)。另 TestSaveDefaultChat 的 0600 权限断言 Windows-only 失败(Go 在 Windows 报 0666),改为 unix-only 断言。 - doctor_test.go/install_test.go: /bin/true → existingExecutable(t) (os.Executable) - config_test.go: 0600 断言 runtime.GOOS != windows 时才校验 | 2 个月前 | |
fix(release): download clobber/skip, named-asset strictness, streaming upload, view/delete polish download: an existing file was silently overwritten (temp+rename with no existence check), and a mistyped asset name exited 0 with "No assets to download" — scripts could not tell a typo from an empty release. Existing files now refuse by default with --clobber to overwrite and --skip-existing to skip (mutually exclusive, gh-aligned). Named downloads are strict: any miss is an error listing the available asset names, and the named set bypasses the source-archive filter — naming an archive explicitly is intent and must download it even without --all. upload: the whole file was buffered in memory (io.ReadAll then a []byte PUT — double the asset size, OOM territory for large binaries); UploadToURL and UploadReleaseAssetByTag now take an io.Reader with an explicit ContentLength (presigned URLs reject chunked PUTs) and uploadFile streams from the file handle with a 512-byte sniff-and-rewind for content type. The platform's overwrite behavior for duplicate asset names is undefined, so a GetRelease precheck refuses the whole batch (zero PUTs) when any name collides, pointing at delete-asset or a rename. A mid-batch failure now names what already landed. The --label example that errors when copied is gone (the flag stays, with its explicit rejection). delete: the confirmation prompt showed the release Name but expected the tag — when they differ, typing what the screen says was rejected. confirmTitle shows "Name (tag: tag)" so the expected input is always visible; Expected stays the tag (the API key). view: gained its first run-level tests (web/TTY/non-TTY browser fallback via an injected opener matching the pr create seam, JSON, human render, not-found wrapping). list: the body-first-line truncate was byte-based and corrupted CJK text at the 60-byte boundary; a shared rune-aware output.Truncate now serves release list, issue templates (same latent bug), and the plugin list (which had its own correct copy). COMMANDS.md documents the new download/upload semantics and fixes the extension-name wording for source archives (detection is by URL, not extension). Co-Authored-By: Claude Code <noreply@anthropic.com> | 27 天前 | |
fix(precommit): enforce pre-push hooks | 2 个月前 | |
refactor: extract roundTripFunc to pkg/testutil Replace 17 duplicate roundTripFunc type definitions across test files with a single shared RoundTripFunc in pkg/testutil. - Add pkg/testutil/roundtrip.go with RoundTripFunc type and NewRoundTripFunc() - Update 18 test files to use testutil.NewRoundTripFunc() - All 1214 tests pass, build succeeds Refs #347 Co-Authored-By: Claude <noreply@anthropic.com> | 3 个月前 |