Gemini 3.8 Flash · Heavy

feature-can-edit-category-host-relationships-for-embedding-discourse-cursor

Discourse · Ruby · M · 100–299 lines · 6 files

The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Haiku 5.5.

Gold bugs found
1 of 4
Comments published
3
Comments matching a bug
1
Comments not matching
2
Cost of this PR
$0.953

Published comments (3)

highbugdb/migrate/20150818190757_create_embeddable_hosts.rb:9-16

NoMethodError when indexing query results without checking row presence — If `embed_category` or `uncategorized_category_id` returns no rows, indexing `[0]` raises `NoMethodError`. Verify the query results are present before reading `['id']` or `['value']`.

mediumbugspec/models/topic_spec.rb:1403-1405

Obsolete test for blank embeddable_host in Topic#expandable_first_post? — `Topic#expandable_first_post?` no longer checks embeddable hosts, so this test passes vacuously regardless of host state. Remove this spec or update it to test `SiteSetting.embed_truncate?` and `has_topic_embed?`.

mediumbugapp/models/embeddable_host.rb:5-8

NoMethodError when host is nil in before_validation callback — A blank or missing `self.host` causes `sub!` to raise `NoMethodError`, crashing with a 500 error instead of validation failures. Guard the mutations with `if self.host.present?`.

Gold bugs found (1)

highThe migration reads execute(...)[0]['id'] for embed_category without checking for an empty result, so installs without that setting stored crash the migration instead of falling back to the uncategorized category.

Gold bugs missed (3)

mediumAfter saving a host, the component overwrites its category with findById(categoryId); when no category was chosen this is null even though the server saved the uncategorized category, so the row shows no category until reload.
highHosts saved with a port (allowed by the validation regex) are stored as host:port, but lookup compares only URI.host, so those configured hosts never match and embedding fails for them.
highEmbeddableHost's host format validation only accepts TLDs of 2-5 letters, so admins cannot add embeddable hosts on longer TLDs like example.technology.