Comments posted with an app's API key show the key creator's name instead of the app #127

Open
opened 2026-11-27 11:45:50 -05:00 by jared · 0 comments
Owner

Found in Thor's end-to-end check on prod (2026-11-27, operator-approved), on test ticket 660393034.

What happens

  • Thor posted two comments through api/ticket_comment_api.php with its own Bearer key.
  • On the ticket and in MCP get_ticket, both show author "Jared Vititoe", the person who created the key, not thor.
  • The ticket itself is right: source: thor, and the Created By column reads "thor (API)".

Why

  • ticket_comment_api.php (header comment, lines 8-9): "the comment author (ticket_comments.user_name) is the API key's key_name and the linked user_id is the key's created_by."
  • The stored user_name is thor, but the display resolves user_id to that user's display name.
  • #124 fixed the display for comments linked to the system user ("comments linked to the system user now display their stored author"). It did not fix comments linked to a real user through an app key.

Impact

  • Every Thor "Also seen", "Escalated", "Cleared" and "Root cause" comment reads as if the operator wrote it by hand.
  • The same will happen for Gandalf and hwmonDaemon once they comment through this endpoint (gandalf#66 item 3, hwmonDaemon#42).

Wanted

  • A comment created through ticket_comment_api.php with an API key displays the key's name, credited the same way as tickets: "thor (API)". That applies in the UI, the MCP get_ticket author and the activity timeline.
  • Keep the linked user_id if it's needed for permissions or audit, but don't use it for display.
  • It might be simplest to mark API-key comments (for example a source column on ticket_comments, or a flag) rather than infer it from user_id.

Related

Found in Thor's end-to-end check on prod (2026-11-27, operator-approved), on test ticket 660393034. ## What happens - Thor posted two comments through `api/ticket_comment_api.php` with its own Bearer key. - On the ticket and in MCP `get_ticket`, both show **author "Jared Vititoe"**, the person who created the key, not **thor**. - The ticket itself is right: `source: thor`, and the Created By column reads "thor (API)". ## Why - `ticket_comment_api.php` (header comment, lines 8-9): "the comment author (ticket_comments.user_name) is the API key's key_name and the linked user_id is the key's created_by." - The stored `user_name` is `thor`, but the display resolves `user_id` to that user's display name. - #124 fixed the display for comments linked to the `system` user ("comments linked to the system user now display their stored author"). It did not fix comments linked to a real user through an app key. ## Impact - Every Thor "Also seen", "Escalated", "Cleared" and "Root cause" comment reads as if the operator wrote it by hand. - The same will happen for Gandalf and hwmonDaemon once they comment through this endpoint (gandalf#66 item 3, hwmonDaemon#42). ## Wanted - A comment created through `ticket_comment_api.php` with an API key displays the key's name, credited the same way as tickets: "thor (API)". That applies in the UI, the MCP `get_ticket` author and the activity timeline. - Keep the linked `user_id` if it's needed for permissions or audit, but don't use it for display. - It might be simplest to mark API-key comments (for example a `source` column on `ticket_comments`, or a flag) rather than infer it from `user_id`. ## Related - LotusGuild/thor#12 (Thor's live path) - #123, #124
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/tinker_tickets#127