') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); feat: add fusion api url by leavesster · Pull Request #471 · oomol/oocana-python · GitHub
Skip to content

feat: add fusion api url - #471

Merged
leavesster merged 2 commits into
mainfrom
fusion-api
Mar 17, 2026
Merged

feat: add fusion api url#471
leavesster merged 2 commits into
mainfrom
fusion-api

Conversation

@leavesster

Copy link
Copy Markdown
Contributor

No description provided.

CopilotAI review requested due to automatic review settings March 17, 2026 03:15
@leavesster
leavesster enabled auto-merge (squash) March 17, 2026 03:15
@coderabbitai

coderabbitaiBot commented Mar 17, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fdbbadfe-8b6d-4ab3-ab2d-227b506f6b09

📥 Commits

Reviewing files that changed from the base of the PR and between 3545fc8 and 66c16be.

📒 Files selected for processing (1)
  • oocana/oocana/context.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • oocana/oocana/context.py

Summary by CodeRabbit

发布说明

  • 新功能
    • 添加对 OOMOL Fusion API 端点配置的支持:可通过环境变量设置自定义 API URL(未设置时默认为空),方便在不同部署环境中指向所需的 Fusion 服务。

Walkthrough

Context 类中新增了公共属性 oomol_fusion_api_url,从环境变量 OOMOL_FUSION_API_URL 读取并返回字符串,默认值为空字符串;未修改其它逻辑或调用点。

Changes

Cohort / File(s)Summary
属性添加
oocana/oocana/context.py
Context 类中新增属性方法 oomol_fusion_api_url(self) -> str,包含文档字符串,返回环境变量 OOMOL_FUSION_API_URL 或空字符串。

Estimated code review effort

🎯 1 (简单) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 inconclusive)

Check nameStatusExplanationResolution
Description check❓ InconclusiveNo pull request description was provided by the author, making it impossible to evaluate relevance to the changeset.请添加拉取请求描述,说明此更改的目的、背景和相关上下文信息。
✅ Passed checks (1 passed)
Check nameStatusExplanation
Title check✅ PassedThe title follows the required format '(): ' (without scope) and accurately describes the main change of adding a fusion API URL property.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Context property to expose the Oomol Fusion API base URL via an environment variable, making it accessible to blocks through the existing context interface.

Changes:

  • Introduced Context.oomol_fusion_api_url property.
  • Reads OOMOL_FUSION_API_URL from the environment (defaults to an empty string).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment threadoocana/oocana/context.py Outdated
Comment threadoocana/oocana/context.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@leavesster
leavesster merged commit 084e1a5 into mainMar 17, 2026
8 checks passed
@leavesster
leavesster deleted the fusion-api branch March 17, 2026 03:22
@oomol-botoomol-bot mentioned this pull request Mar 17, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@leavesster