MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / add

Method add

src/command_system/input_processing.py:804–814  ·  view source on GitHub ↗

Add an entry to history.

(self, text: str)

Source from the content-addressed store, hash-verified

802 self._cursor: int = -1
803
804 def add(self, text: str) -> None:
805 """Add an entry to history."""
806 if not text.strip():
807 return
808 # Don't add duplicates of the last entry
809 if self._entries and self._entries[-1] == text:
810 return
811 self._entries.append(text)
812 if len(self._entries) > self._max_entries:
813 self._entries.pop(0)
814 self._cursor = len(self._entries)
815
816 def previous(self) -> str | None:
817 """Get previous history entry (up arrow)."""

Callers 15

test_add_and_entriesMethod · 0.95
test_empty_not_addedMethod · 0.95
test_previousMethod · 0.95
test_nextMethod · 0.95
test_next_past_endMethod · 0.95
test_searchMethod · 0.95
test_max_entriesMethod · 0.95
test_clearMethod · 0.95
get_commandsFunction · 0.45
expand_at_mentionsFunction · 0.45
expand_agent_mentionsFunction · 0.45

Calls 1

appendMethod · 0.45

Tested by 9

test_add_and_entriesMethod · 0.76
test_empty_not_addedMethod · 0.76
test_previousMethod · 0.76
test_nextMethod · 0.76
test_next_past_endMethod · 0.76
test_searchMethod · 0.76
test_max_entriesMethod · 0.76
test_clearMethod · 0.76