Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/telegram_codex_bot/transcript_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,15 @@ class TranscriptParser:
# Magic string constants
_NO_CONTENT_PLACEHOLDER = "(no content)"
_INTERRUPTED_TEXT = "[Request interrupted by user for tool use]"
_INTERNAL_TOOL_NAMES = {"update_plan", "view_image", "viewimage"}
_INTERNAL_TOOL_NAMES = {
"create_goal",
"get_goal",
"tool_search_tool",
"update_goal",
"update_plan",
"view_image",
"viewimage",
}
_MAX_SUMMARY_LENGTH = 200
_AUTH_ERROR_HINT_MARKERS = (
"could not be refreshed",
Expand Down
31 changes: 31 additions & 0 deletions tests/telegram_codex_bot/test_transcript_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,37 @@ def test_view_image_tool_calls_are_hidden_from_messages(self):
assert result == []
assert pending == {}

@pytest.mark.parametrize("tool_name", ["get_goal", "create_goal", "update_goal"])
def test_goal_lifecycle_tool_calls_are_hidden_from_messages(self, tool_name: str):
use_item = {
"type": "response_item",
"timestamp": "2026-06-08T09:40:05Z",
"payload": {
"type": "function_call",
"call_id": f"call_{tool_name}",
"name": tool_name,
"arguments": json.dumps({"status": "complete"}),
},
}
result_item = {
"type": "response_item",
"timestamp": "2026-06-08T09:40:06Z",
"payload": {
"type": "function_call_output",
"call_id": f"call_{tool_name}",
"output": json.dumps({"goal": {"status": "complete"}}),
},
}

entries = [
TranscriptParser.parse_line(json.dumps(use_item)),
TranscriptParser.parse_line(json.dumps(result_item)),
]
result, pending = TranscriptParser.parse_entries([e for e in entries if e])

assert result == []
assert pending == {}

def test_response_item_function_call_output_is_normalized_as_tool_result(self):
item = {
"type": "response_item",
Expand Down
Loading