No reviewers
Labels
No labels
backend
bug
chore
duplication
effort:complex
effort:medium
effort:trivial
enhancement
frontend
fullstack
priority:high
ready-for-agent
refactor
security
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dries/ocman!220
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-42"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Addresses the DUP-GO dedup issues, one commit each:
listViaAdapter[T]collapses the identical agents/commands/questions session handlers. Scope reduced from the issue:handleSessionPermissionshas since grown auto-approve resurrection logic andhandleSessionModelsreturns a pointer response, so both keep their own bodies.marshalRequestcentralises the 8x-repeatedfmt.Errorf("marshal request: %w", err)wrapping inopencode/operations.go. The table-driven rewrite of the nine operations was skipped deliberately: they diverge in HTTP verb, retry, and cache-invalidation behaviour.validateStateRequestextracts the shared validateID + resolvePlatformIDForState preamble from the seen/archive/pin handlers.paginateSlice[T]+costDescLessdedupe the offset/limit clamping and cost-descending sort inpopulateSessionLog/populateProjectLog, with table-driven tests.parseAbsDirextracts the required-and-absolute?dir=validation from five GET handlers (git, worktree, project-upstream). The suggestedresolveWorktreeRootextraction is obsolete: those handlers now delegate through the hostsvc router.Not included — already fixed on main:
handleSessionsandhandleSessionsNotifyalready sharefanOutSessions(internal/server/fanout.go). Issue can be closed as done.Bonus fix (first commit):
initOriginRepo(server) andinitRepo(hostsvc/local) inheritedos.Environ()for git subprocesses. When the test suite runs inside a git hook (pre-commit exportsGIT_DIR/GIT_INDEX_FILE), theirgit init/remote/add/commitoperated on the real repository instead of the temp dir — observed live as a strayinitcommit byt <t@e>landing on this branch during a commit. Reproduced red (hook-env test run corrupted the repo), green after switching togitexec.CleanEnv()like every other git-spawning helper.Verified:
go vet ./..., fullgo test ./...(one unrelated flake:TestEnsureToolPathRecoversBinaryraces on PATH under full-suite parallelism; passes in isolation and on main), platform-branching check.The fmt.Errorf("marshal request: %w", err) wrapping appeared identically 8 times across the mutating operations. Centralise it in one marshalRequest helper. The table-driven rewrite suggested in the issue is skipped deliberately: the nine operations diverge in HTTP verb, retry, and cache-invalidation behaviour, so a table would obscure more than it saves. Closes #43Coverage ratchet: ✅ pass
Tolerance: -0.1%. Baseline stored on
gh-pages.b5d578e2b1d1114a9a65