MCPcopy Create free account
hub / github.com/codehamr/codehamr / runSlash

Method runSlash

internal/tui/slash.go:85–95  ·  view source on GitHub ↗

runSlash dispatches a slash-prefixed submission; unknown commands produce a quiet hint, not an error. config.yaml is re-read before every slash so hand-edits take effect without a restart (see reloadConfigFromDisk).

(text string)

Source from the content-addressed store, hash-verified

83}
84
85// reloadConfigFromDisk reruns config.Bootstrap and replaces m.cfg so hand edits
86// to config.yaml between slash commands take effect immediately. URLOverride
87// (from CODEHAMR_URL) is carried across the swap so the env var keeps applying.
88//
89// Returns the Bootstrap error verbatim; callers decide whether to surface it
90// (runSlash warns on submit; the popover refresh path ignores it so a broken
91// file doesn't spam a warning on every keystroke).
92//
93// Rebuilds the llm.Client when the active profile's resolved (URL, model, key)
94// triple changed: covers both within profile edits and a moved active.
95func (m *Model) reloadConfigFromDisk() error {
96 projectRoot := filepath.Dir(m.cfg.Dir)
97 fresh, _, err := config.Bootstrap(projectRoot)
98 if err != nil {

Calls 4

reloadConfigFromDiskMethod · 0.95
appendLineMethod · 0.95
commandByNameFunction · 0.85
ErrorMethod · 0.80