Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/codehamr/codehamr
/ functions
Functions
622 in github.com/codehamr/codehamr
⨍
Functions
622
◇
Types & classes
43
Function
TestHamrpassRejectsTooShort
TestHamrpassRejectsTooShort: a key under hamrpassMinKeyLen is refused without touching the profile or the active selection.
internal/tui/tui_test.go:3025
Function
TestHamrpassSetsKeyAndActivates
TestHamrpassSetsKeyAndActivates: a valid key is trimmed, saved on the hamrpass profile, persisted, and active flips to hamrpass. The llm client is reb
internal/tui/tui_test.go:2956
Function
TestHandleProbeSuccessUpdatesLiveCtxAndPrintsActivation
TestHandleProbeSuccessUpdatesLiveCtxAndPrintsActivation: a successful probeMsg writes the live context window into liveContextSize (per profile) and p
internal/tui/tui_test.go:1210
Function
TestHandleStreamClosedEndsTurnWithNoPending
TestHandleStreamClosedEndsTurnWithNoPending: handleStreamClosed with an empty pending queue finalizes the turn, returns to idle, and returns no follow
internal/tui/tui_test.go:1158
Function
TestHandleStreamClosedSkipsAdvanceAfterCancel
TestHandleStreamClosedSkipsAdvanceAfterCancel: after Ctrl+C leaves phase=idle, the deferred streamClosedMsg must not auto-restart a turn (the agent re
internal/tui/tui_test.go:2570
Function
TestHandleStreamDrainsAfterCancel
TestHandleStreamDrainsAfterCancel: buffered stream events can arrive after Ctrl+C returned phase to idle. Processing them would write ghost tokens, re
internal/tui/tui_test.go:2545
Function
TestHeadTailBufferKeepsExactHeadAndTail
TestHeadTailBufferKeepsExactHeadAndTail: once the middle is dropped, the reassembly must carry exactly the first head-cap bytes and the last tail-cap
internal/tools/bash_test.go:86
Function
TestHeadTailBufferSmallOutputUntouched
TestHeadTailBufferSmallOutputUntouched: output under the head cap must come back byte-identical - the bounding must be invisible in the normal case.
internal/tools/bash_test.go:74
Function
TestHeightOnlyResizeDoesNotClear
TestHeightOnlyResizeDoesNotClear: a height-only change can't induce the soft-wrap that breaks bubbletea's cursor math (no line widens), so the hardeni
internal/tui/resize_test.go:202
Function
TestHistoryDownRestoresUnsentDraft
TestHistoryDownRestoresUnsentDraft: an unsent draft survives a ↑ into history and is restored when ↓ walks back to the live line.
internal/tui/tui_test.go:524
Function
TestHistoryPushesOnSubmit
TestHistoryPushesOnSubmit: successful submit appends to promptHistory and resets the walker index to -1.
internal/tui/tui_test.go:542
Function
TestHistoryUpDownReplayLastSubmission
TestHistoryUpDownReplayLastSubmission: ↑ on first-line replaces textarea with the most recent submitted line; ↓ steps back toward the draft.
internal/tui/tui_test.go:491
Function
TestHumanIntFormat
TestHumanIntFormat: thin-comma formatting must handle the edge cases the activation line cares about: single digits, exact 4-digit, exact powers, and
internal/tui/tui_test.go:1546
Function
TestHumanRateFormat
TestHumanRateFormat: throughput as `N tok/s`. Degenerate inputs (zero tokens or zero elapsed) collapse to "" so the banner omits the segment. Sub-10 t
internal/tui/tui_test.go:1630
Function
TestHumanTokensFormat
TestHumanTokensFormat: the session counter renders compactly: plain int under 1000, then `k`/`M` with a constant single decimal. The decimal is always
internal/tui/tui_test.go:1569
Function
TestIdleTimeoutFromEnv
TestIdleTimeoutFromEnv pins the CODEHAMR_IDLE_TIMEOUT contract: a Go duration or bare-seconds string wins, anything else (unset, garbage, non-positive
internal/llm/llm_test.go:830
Function
TestInlineStatusBash
(t *testing.T)
internal/tools/bash_test.go:250
Function
TestInlineStatusEditFile
(t *testing.T)
internal/tools/edit_test.go:205
Function
TestInlineStatusGeneric
(t *testing.T)
internal/tools/bash_test.go:258
Function
TestInlineStatusReadFile
(t *testing.T)
internal/tools/read_test.go:106
Function
TestInlineStatusRuneBoundaryTruncate
TestInlineStatusRuneBoundaryTruncate: truncating a long non-ASCII command at a fixed byte offset can split a multi-byte rune, leaving an orphan contin
internal/tools/bash_test.go:270
Function
TestInlineStatusWriteFile
(t *testing.T)
internal/tools/write_test.go:168
Function
TestIsLocalBuild
TestIsLocalBuild pins the contract: `go run` ("dev"), dirty-tree builds, clean-tree builds past the last tag (git describe shape), and tag-less clones
cmd/codehamr/main_test.go:14
Function
TestLargePasteBecomesChip
TestLargePasteBecomesChip: a ≥pasteChipMinLines paste collapses to one chip. DisplayValue shows the label, Value expands back to the original.
internal/tui/prompt_test.go:74
Function
TestLeftArrowAtChipEndJumpsToStart
TestLeftArrowAtChipEndJumpsToStart: ← jumps the cursor across the whole chip in one keystroke; it never lands on interior positions.
internal/tui/prompt_test.go:133
Function
TestLiveElapsed
TestLiveElapsed: the running wall-clock readout, whole seconds under a minute (no spinning sub-second decimal at the spinner's refresh rate), then `6m
internal/tui/tui_test.go:1600
Function
TestLongSingleLinePasteChipsByCharCount
TestLongSingleLinePasteChipsByCharCount: a long single-line blob (zero newlines) still collapses: char threshold catches minified JSON and one-line st
internal/tui/prompt_test.go:457
Function
TestMessageTokensCountsToolCallArguments
TestMessageTokensCountsToolCallArguments pins ToolCall.Arguments accounting in Message.Tokens: it feeds the budget on every tool-using turn, yet no ot
internal/ctx/ctx_test.go:45
Function
TestModelBracketedPasteCreatesChip
TestModelBracketedPasteCreatesChip checks a bracketed-paste KeyMsg through Model.Update reaches promptInput.Update and yields a chip, guarding against
internal/tui/paste_integration_test.go:14
Function
TestMultiToolCallRoundExecutesAllBeforeNextChat
TestMultiToolCallRoundExecutesAllBeforeNextChat: when the model emits multiple tool calls in one round, EVERY result must be appended to history BEFOR
internal/tui/tui_test.go:3107
Function
TestNewHasNoHTTPTimeout
TestNewHasNoHTTPTimeout pins that the streaming Client must NOT set http.Client.Timeout: that field is end-to-end (it covers body reads) and would abo
internal/llm/llm_test.go:819
Function
TestNewestAssistantEmpty
TestNewestAssistantEmpty pins the anomaly detector behind the empty-reply nudge: only a newest assistant message with neither text nor a structured to
internal/tui/tui_test.go:3202
Function
TestNonCtrlCKeypressResetsArming
TestNonCtrlCKeypressResetsArming: once arming is live, pressing anything other than Ctrl+C clears the arm so the next idle Ctrl+C re-arms cleanly (no
internal/tui/tui_test.go:215
Function
TestPackAlwaysKeepsNewest
(t *testing.T)
internal/ctx/ctx_test.go:114
Function
TestPackAnchorsTaskEvenWithSystemNudge
TestPackAnchorsTaskEvenWithSystemNudge: a long single turn evicts the sole user task, and a nudge (system) is the newest message. The system→user demo
internal/ctx/ctx_test.go:570
Function
TestPackAnchorsUserTaskOverBudget
TestPackAnchorsUserTaskOverBudget: a long single turn (one small task message, then many large assistant rounds that fill the budget) would let the ne
internal/ctx/ctx_test.go:483
Function
TestPackDemotesSystemNudgeToUser
TestPackDemotesSystemNudgeToUser: the four soft-nudge backstops append a system-role note to history. buildMessages prepends the embedded system promp
internal/ctx/ctx_test.go:547
Function
TestPackDropsDanglingAssistantDespiteIDReuse
TestPackDropsDanglingAssistantDespiteIDReuse: pairing is positional, not a global ID lookup. Local backends commonly reuse index-derived IDs ("call_0"
internal/ctx/ctx_test.go:333
Function
TestPackDropsDanglingAssistantToolCalls
TestPackDropsDanglingAssistantToolCalls: a turn cancelled mid-tool leaves an assistant.tool_calls in history with no answering tool message (the TUI a
internal/ctx/ctx_test.go:285
Function
TestPackDropsDanglingPartialParallelGroup
TestPackDropsDanglingPartialParallelGroup: cancelling a parallel round after only some results return leaves assistant(c1,c2)+tool(c1). The assistant
internal/ctx/ctx_test.go:308
Function
TestPackDropsEmptyIDToolMessages
TestPackDropsEmptyIDToolMessages: an empty-ID tool_call must not let subsequent empty-ToolCallID tool messages ride through as "paired". An unidentifi
internal/ctx/ctx_test.go:156
Function
TestPackDropsOrphanToolMessage
TestPackDropsOrphanToolMessage: if budget-trimming cuts the assistant whose tool_calls spawned a tool message, that orphan must be dropped, else OpenA
internal/ctx/ctx_test.go:132
Function
TestPackDropsStrayToolResultDespiteIDReuse
TestPackDropsStrayToolResultDespiteIDReuse: dropOrphanTools is positional too. A stray tool result whose own (dangling, dropped) assistant reused an o
internal/ctx/ctx_test.go:435
Function
TestPackKeepsFullyAnsweredToolCalls
TestPackKeepsFullyAnsweredToolCalls: don't over-reach. An assistant whose every tool_call is answered (including parallel) must survive intact.
internal/ctx/ctx_test.go:463
Function
TestPackKeepsNewestParallelToolGroupOverBudget
TestPackKeepsNewestParallelToolGroupOverBudget: with parallel tool calls the tail is [assistant(c1,c2), tool(c1), tool(c2)], so the newest tool's owne
internal/ctx/ctx_test.go:224
Function
TestPackKeepsNewestToolPairOverBudget
TestPackKeepsNewestToolPairOverBudget: when the newest message is a tool result and its owning assistant won't fit the budget, Pack must keep the pair
internal/ctx/ctx_test.go:193
Function
TestPackKeepsPairedToolMessage
TestPackKeepsPairedToolMessage: a healthy assistant+tool pair that fits the budget stays intact: don't regress into dropping good pairs.
internal/ctx/ctx_test.go:176
Function
TestPackNewestFirstWhole
(t *testing.T)
internal/ctx/ctx_test.go:93
Function
TestPackNoStaleAnchorWhenRecentUserSurvives
TestPackNoStaleAnchorWhenRecentUserSurvives: in a normal multi-turn chat a recent user message already survives the walk, so Pack must NOT also drag t
internal/ctx/ctx_test.go:511
Function
TestPackRecoversNewestToolGroupPastEmptyAssistantTail
TestPackRecoversNewestToolGroupPastEmptyAssistantTail: the stall shape the empty-reply nudge answers appends an EMPTY assistant message, then the nudg
internal/ctx/ctx_test.go:404
Function
TestPackRecoversNewestToolGroupPastTrailingNudge
TestPackRecoversNewestToolGroupPastTrailingNudge: the over-budget recovery for the newest tool exchange must fire even when a failure/runaway nudge wa
internal/ctx/ctx_test.go:365
Function
TestPackRecoveryDropsPartialParallelGroup
TestPackRecoveryDropsPartialParallelGroup: the empty-recovery path (newest is a tool result whose owner fell past a tight budget) must not resurrect a
internal/ctx/ctx_test.go:259
Function
TestPageKeysMoveCursorByHeight
TestPageKeysMoveCursorByHeight: PgUp/PgDn move the cursor by one prompt-height. bubbles/textarea ships an empty viewport keymap, so without our handli
internal/tui/prompt_test.go:373
Function
TestPasteIntoChipInteriorKeepsBothPastes
TestPasteIntoChipInteriorKeepsBothPastes: a paste while the cursor sits inside an existing chip's label must not splice the new label into the old one
internal/tui/prompt_test.go:491
Function
TestPasteWithoutFlagButWithNewlineStillChips
TestPasteWithoutFlagButWithNewlineStillChips: some terminals omit the bracketed-paste flag, yet multi-line content in one KeyMsg can't come from typin
internal/tui/prompt_test.go:441
Function
TestPlaceholderMentionsTab
TestPlaceholderMentionsTab: placeholder names both "/" and "Tab" as entry points into the popover, so new users discover either way.
internal/tui/tui_test.go:129
Function
TestPopoverArrowKeysMoveSelection
TestPopoverArrowKeysMoveSelection: while popover is open, ↑/↓ move the selection (NOT arrow history), and the textarea is not clobbered.
internal/tui/tui_test.go:397
Function
TestPopoverClosesWhenPrefixMatchesNothing
TestPopoverClosesWhenPrefixMatchesNothing: typing a prefix that no command satisfies closes the popover automatically (no empty frame).
internal/tui/tui_test.go:268
Function
TestPopoverEnterAdvancesIntoArgsForArgsCommand
TestPopoverEnterAdvancesIntoArgsForArgsCommand: Enter at command-level on a command that takes args does NOT submit: it opens the arg-level popover, s
internal/tui/tui_test.go:416
Function
TestPopoverEnterSubmitsNoArgCommand
TestPopoverEnterSubmitsNoArgCommand: Enter at command-level on a command without args still submits immediately (/clear).
internal/tui/tui_test.go:439
Function
TestPopoverRenderHasNoMarker
TestPopoverRenderHasNoMarker: no row in the rendered popover is prefixed with the old `▸ ` arrow or a 2-space marker. Selection is a colour change, no
internal/tui/tui_test.go:2771
Function
TestPopoverRenderRightAligns
TestPopoverRenderRightAligns: each row ends flush with the popover width (== m.width after ANSI stripping). The value starts at column 0 and the descr
internal/tui/tui_test.go:2889
Function
TestPopoverSelectionStaysVisible
TestPopoverSelectionStaysVisible: with more than popoverCap suggestions the popover renders a window; when the selection moves past it, renderPopover
internal/tui/tui_test.go:2785
Function
TestPopoverShiftTabCyclesUp
TestPopoverShiftTabCyclesUp: Shift+Tab walks the selection backwards, wrapping at the top.
internal/tui/tui_test.go:361
Function
TestPopoverTabCompletesUniquePrefix
TestPopoverTabCompletesUniquePrefix: with one match, Tab completes the name and, because /models takes args, appends a space that flips the popover in
internal/tui/tui_test.go:328
Function
TestPopoverTabCyclesSelection
TestPopoverTabCyclesSelection: Tab moves the selection to the next row without touching the textarea, zsh-style cycling.
internal/tui/tui_test.go:278
Function
TestPopoverTabOnClearCommandHasNoArgSpace
TestPopoverTabOnClearCommandHasNoArgSpace: /clear takes no args, so Tab completes to "/clear" WITHOUT a trailing space.
internal/tui/tui_test.go:347
Function
TestPopoverTabOnEmptyOpensCommandList
TestPopoverTabOnEmptyOpensCommandList: Tab on an empty textarea is equivalent to typing "/": it opens the popover with the full command list. Subseque
internal/tui/tui_test.go:301
Function
TestPopoverTriggersOnSlash
TestPopoverTriggersOnSlash: typing / into an empty textarea opens the popover with every command; typing more characters filters by prefix.
internal/tui/tui_test.go:249
Function
TestPrintHelpListsAllCommands
TestPrintHelpListsAllCommands: tui.PrintHelp formats every command in the central slice. Guards against a command being added to runSlash dispatch but
internal/tui/tui_test.go:581
Function
TestProbeBudgetExhaustedUpdatesStatusBar
TestProbeBudgetExhaustedUpdatesStatusBar: a 402 probe carries a BudgetStatus{Set:true, Remaining:0} snapshot. handleProbe must apply it to m.budget so
internal/tui/tui_test.go:1301
Function
TestProbeBudgetSnapshotIgnoredForStaleProfile
TestProbeBudgetSnapshotIgnoredForStaleProfile: a budget snapshot from a probe that lost the /models race (msg.profile != m.cfg.Active) must not overwr
internal/tui/tui_test.go:1323
Function
TestProbeChatNoReasoningEffortIsRaceFree
TestProbeChatNoReasoningEffortIsRaceFree pins the atomic.Bool guard on Client.noReasoningEffort. The startup probe and the first chat can run on the s
internal/llm/llm_test.go:697
Function
TestProbeForVanishedProfileLeavesNoOrphanMapEntry
TestProbeForVanishedProfileLeavesNoOrphanMapEntry: probeMsg must check the targeted profile still exists before writing liveContextSize, or rapid /mod
internal/tui/tui_test.go:1233
Function
TestPromptAutoGrowsWithContent
TestPromptAutoGrowsWithContent: the textarea starts at 1 line, grows with newlines, and clamps to height - minViewport - 2 - popover, so big pastes us
internal/tui/tui_test.go:2388
Function
TestPromptGrowsOnWrappedLongLine
TestPromptGrowsOnWrappedLongLine: a long paragraph typed without Enter has LineCount()==1, so relying on it sticks the textarea at 1 row while text wr
internal/tui/tui_test.go:2374
Function
TestPromptHistoryCap
TestPromptHistoryCap: exceeding historyMaxEntries drops the oldest, not the newest, otherwise the file grows unbounded.
internal/tui/history_store_test.go:38
Function
TestPromptHistoryClear
TestPromptHistoryClear: clearPromptHistory removes the file; a missing file is not an error. Mirrors /clear semantics.
internal/tui/history_store_test.go:73
Function
TestPromptHistoryConcurrentAppendsKeepBoth
TestPromptHistoryConcurrentAppendsKeepBoth guards the load-then-rewrite race: two instances sharing a project dir would each read N entries and overwr
internal/tui/history_store_test.go:109
Function
TestPromptHistoryCorruptLineSkipped
TestPromptHistoryCorruptLineSkipped: a malformed line (users may hand-edit the file) must not poison the valid entries around it.
internal/tui/history_store_test.go:92
Function
TestPromptHistoryQuotedLineStaysLoadable
TestPromptHistoryQuotedLineStaysLoadable guards the quote-expansion gap: strconv.Quote expands each control/invalid byte to \xNN (4× growth), so a val
internal/tui/history_store_test.go:153
Function
TestPromptHistoryRejectsHugeEntry
TestPromptHistoryRejectsHugeEntry: a multi-MiB paste isn't stored, the load scanner would silently drop it anyway, so declining to write is consistent
internal/tui/history_store_test.go:178
Function
TestPromptHistoryRoundTrip
TestPromptHistoryRoundTrip: values with newlines/quotes/unicode survive a disk round-trip in append order, the on-disk format must carry any byte the
internal/tui/history_store_test.go:14
Function
TestPromptHistorySkipEmpty
TestPromptHistorySkipEmpty: empty submits never reach the file, so a stray ↵ can't pollute recall with blanks.
internal/tui/history_store_test.go:58
Function
TestPromptShrinksAfterSubmit
TestPromptShrinksAfterSubmit: after Enter submits a multi-line prompt the textarea resets to empty and the height snaps back to 1 line.
internal/tui/tui_test.go:2413
Function
TestPublishedManifestMatchesAssetName
TestPublishedManifestMatchesAssetName is opt-in: point CODEHAMR_CHECK_MANIFEST at a goreleaser checksums file (CI sets it to dist/codehamr_checksums.t
internal/update/drift_test.go:109
Function
TestQueueAutoFireUnitFromStreamClosed
TestQueueAutoFireUnitFromStreamClosed: a clean, trivial finish with a prompt queued must submit it from handleStreamClosed: phase back to thinking, a
internal/tui/queue_test.go:343
Function
TestQueueAutoSubmitsAfterTurn
TestQueueAutoSubmitsAfterTurn drives a full turn with a prompt queued mid-flight and asserts the queued prompt auto-fires a second request when the tu
internal/tui/queue_test.go:127
Function
TestQueueEmptyMidTurnIsNoOp
TestQueueEmptyMidTurnIsNoOp: Enter on a blank prompt mid-turn stays silent, so a reflexive Enter while watching the agent doesn't queue an empty slot.
internal/tui/queue_test.go:48
Function
TestQueueExpandsChipsOnFire
TestQueueExpandsChipsOnFire: a chip-bearing paste queued mid-turn keeps its expanded content for the LLM (send) while the box echo stays collapsed, th
internal/tui/queue_test.go:316
Function
TestQueueRefusesSlashMix
TestQueueRefusesSlashMix: a slash command never newline-joins with a queued prompt, in either order. Joined slash-first, the whole slot would fire as
internal/tui/queue_test.go:87
Function
TestQueueRestoreKeepsExistingDraft
TestQueueRestoreKeepsExistingDraft: if the user was typing a new prompt when they Ctrl+C, that draft wins; the queued prompt is dropped rather than cl
internal/tui/queue_test.go:191
Function
TestQueueRestoredOnCtrlC
TestQueueRestoredOnCtrlC: a Ctrl+C abort never fires the queued prompt (the user took back control); it returns the text to the textarea as an editabl
internal/tui/queue_test.go:166
Function
TestQueueSecondEnterAppends
TestQueueSecondEnterAppends: a second mid-turn Enter appends (newline-joined) to the existing slot, so a multi-part instruction builds up in one queue
internal/tui/queue_test.go:63
Function
TestQueueStoresPromptMidTurn
TestQueueStoresPromptMidTurn: Enter while a turn is running stashes the typed prompt in the queue slot and clears the textarea, instead of the old sil
internal/tui/queue_test.go:20
Function
TestQueueWaitsForVerifyNudge
TestQueueWaitsForVerifyNudge: a substantial clean finish triggers the verify re-grounding nudge, which continues the turn. The queued prompt must NOT
internal/tui/queue_test.go:214
Function
TestQueuedPromptRendersInView
TestQueuedPromptRendersInView: while something is queued the prompt area shows a labeled box with the echo text, so the user can see what will auto-su
internal/tui/queue_test.go:294
Function
TestReachableHitsV1Models
TestReachableHitsV1Models pins the heartbeat path: /v1/models, the OpenAI-standard listing endpoint every backend serves. Probing GET / instead could
internal/cloud/cloud_test.go:14
Function
TestReachableTreatsNon2xxAsReachable
TestReachableTreatsNon2xxAsReachable: any HTTP response counts as reachable (even 404/401); only transport errors and timeouts mean down.
internal/cloud/cloud_test.go:34
Function
TestReadFileEmptyPath
(t *testing.T)
internal/tools/read_test.go:26
← previous
next →
401–500 of 622, ranked by callers