Skip to content

Commit c2b70af

Browse files
scszcoderclaude
andcommitted
ws038: sidebar-row id probe (diagnostic) for card delivery dead-end
A card-on-entry dispatches under a synthetic name (ws033c) but the reply can't be delivered: feige_send_message matches the sidebar row BY NAME, and the synthetic 'card:<conv>' never matches the real row -> "Session not found" -> requeue loop. The sidebar row exposes no documented conversation/talk id (data-btm = last-message id, data-btm-id = .current/.recent/.systemConv state marker), so we can't yet deliver by conv. Add a diagnostic-only probe (no behavior change): on a name-match miss, dumpRowIds() collects every data-*/id/href on each conversation row + its descendants, returned as seen_rows and logged UNTRUNCATED as [FEIGE-SIDEBAR-PROBE]. Next run: grep [FEIGE-SIDEBAR-PROBE] and search for the talk_id to decide delivery-by-conv (robust) vs name-resolution (#1). Fires only on the failure path -> zero noise on successful sends. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 4a0016f commit c2b70af

1 file changed

Lines changed: 42 additions & 1 deletion

File tree

agent/ec_skills/browser_use_extension/extension_tools_service.py

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4503,6 +4503,30 @@ async def feige_get_chat_thread(params: FeigeGetChatThreadAction, browser_sessio
45034503
var idEl = row && row.querySelector ? row.querySelector('[data-btm]') : null;
45044504
return idEl ? String(idEl.getAttribute('data-btm') || '').trim() : '';
45054505
}
4506+
function dumpRowIds(row) {
4507+
// ws038 diagnostic: collect every id-candidate attribute (data-* / id / href)
4508+
// on the row AND its descendants, so the next run reveals whether the sidebar
4509+
// exposes a stable conversation/talk id anywhere (none is documented today).
4510+
var out = { _name: readRowName(row) };
4511+
try {
4512+
var nodes = [row].concat(Array.prototype.slice.call(row.querySelectorAll('*')));
4513+
for (var n = 0; n < nodes.length && n < 80; n++) {
4514+
var el = nodes[n];
4515+
if (!el || !el.attributes) continue;
4516+
for (var a = 0; a < el.attributes.length; a++) {
4517+
var nm = el.attributes[a].name;
4518+
if (nm === 'class' || nm === 'style') continue;
4519+
if (nm.indexOf('data-') === 0 || nm === 'id' || nm === 'href') {
4520+
var v = String(el.attributes[a].value || '');
4521+
if (v && v.length < 160) {
4522+
out[nm] = (out[nm] && out[nm].indexOf(v) < 0) ? (out[nm] + '|' + v) : v;
4523+
}
4524+
}
4525+
}
4526+
}
4527+
} catch (e) {}
4528+
return out;
4529+
}
45064530
function readHeaderName() {
45074531
var topbar = document.querySelector('#topbar-left-info');
45084532
if (!topbar) return '';
@@ -4553,7 +4577,8 @@ async def feige_get_chat_thread(params: FeigeGetChatThreadAction, browser_sessio
45534577
error: 'Session not found in current conversations',
45544578
expected_customer: expectedCustomer,
45554579
current_visible: items.length,
4556-
seen_names: items.slice(0, 20).map(readRowName)
4580+
seen_names: items.slice(0, 20).map(readRowName),
4581+
seen_rows: items.slice(0, 20).map(dumpRowIds)
45574582
});
45584583
}
45594584
var rowMsgId = readRowMsgId(target);
@@ -5676,6 +5701,22 @@ async def feige_send_message(params: FeigeSendMessageAction, browser_session: Br
56765701
if isinstance(data, str):
56775702
data = json.loads(data)
56785703
page_timing_fields = _feige_send_page_timing_fields(data)
5704+
# ws038 diagnostic: on a name-match miss, dump every conversation row's
5705+
# id-candidate attributes UNTRUNCATED so we can search the next run for the
5706+
# talk_id and decide whether delivery-by-conv is even possible.
5707+
if (
5708+
isinstance(data, dict)
5709+
and not data.get("sent")
5710+
and "Session not found" in str(data.get("error") or "")
5711+
):
5712+
try:
5713+
logger.warning(
5714+
f"[FEIGE-SIDEBAR-PROBE] expected_cust={expected_customer!r} "
5715+
f"source_msg_id={source_msg_id!r} "
5716+
f"rows={json.dumps(data.get('seen_rows') or [], ensure_ascii=False)}"
5717+
)
5718+
except Exception:
5719+
pass
56795720
if isinstance(data, dict) and data.get("sent"):
56805721
method = data.get("method", "unknown")
56815722
verified = data.get("verified", "unknown")

0 commit comments

Comments
 (0)