Skip to content

feat(dashboard): show plugin logs in installed plugin details - #9861

Open
wdcyxxycdw wants to merge 3 commits into
AstrBotDevs:masterfrom
wdcyxxycdw:feat/plugin-detail-logs
Open

feat(dashboard): show plugin logs in installed plugin details#9861
wdcyxxycdw wants to merge 3 commits into
AstrBotDevs:masterfrom
wdcyxxycdw:feat/plugin-detail-logs

Conversation

@wdcyxxycdw

@wdcyxxycdw wdcyxxycdw commented Aug 28, 2026

Copy link
Copy Markdown

Summary

Add recent and live plugin-scoped logs to installed plugin detail pages.

#9850

Modifications / 改动点

  • Add structured plugin attribution to brokered logs.

  • Filter console history and live updates by plugin.

  • Show the existing console in installed plugin details with level filters, auto-scroll, and fullscreen controls by reusing.

  • Add localized UI text and backend test coverage.

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Scope

  • Logs are limited to the current process and are not persisted across restarts.
  • Plugin attribution applies to astrbot.plugin.<plugin_name> loggers.

Screenshots or Test Results / 运行截图或测试结果

Automated verification

  • uvx --from ruff==0.15.2 ruff format --check . — 501 files already formatted.
  • uvx --from ruff==0.15.2 ruff check . — passed.
  • uv run pytest -q tests/unit/test_api_logger.py — 8 passed.
  • node --test dashboard/tests/*.test.mjs — 39 passed.
  • pnpm --dir dashboard typecheck — passed.
  • pnpm --dir dashboard build — passed.

UI evidence

Plugin-scoped log console

Checklist / 检查清单

  • If there are new features added in the PR, I have discussed them with the authors through an issue, email, or another documented channel.
  • My changes have been well-tested, and verification steps and screenshots have been provided above.
  • My changes introduce no new dependencies, or any new dependencies have been added to the appropriate dependency files.
  • My changes do not introduce malicious code.

Summary by Sourcery

Show live and recent logs for installed plugins directly in their detail pages.

New Features:

  • Add plugin-scoped log consoles to installed plugin detail pages with filtering, level controls, auto-scroll, and fullscreen support.

Bug Fixes:

  • Prevent console log streaming and fullscreen handlers from continuing after the component is unmounted.

Enhancements:

  • Include structured plugin attribution in brokered log records and filter console history and live updates by plugin.
  • Preserve marketplace plugin details without plugin log consoles.

Documentation:

  • Add localized text for the installed plugin log console.

Tests:

  • Add backend coverage for plugin attribution in brokered logs.

@wdcyxxycdw
wdcyxxycdw marked this pull request as ready for review August 28, 2026 10:26
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. area:webui The bug / feature is about webui(dashboard) of astrbot. feature:plugin The bug / feature is about AstrBot plugin system. labels Aug 28, 2026

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="dashboard/src/components/shared/ConsoleDisplayer.vue" line_range="132-135" />
<code_context>
   },
   async mounted() {
     await this.fetchLogHistory();
+    if (this.isUnmounted) {
+      return;
+    }
     this.connectSSE();
     document.addEventListener("fullscreenchange", this.handleFullscreenChange);
   },
</code_context>
<issue_to_address>
**issue (bug_risk):** A history request started by `onopen` or a reconnect timer is not cancelled or rechecked after it resolves, so an unmounted console still processes the response and mutates `localLogCache` after teardown. The added `isUnmounted` checks only guard the initial `mounted` continuation and the reconnection path, not the asynchronous history method itself.

**Triggers:** When the component is unmounted while a history request is in flight.

**Suggested fix:** Check `isUnmounted` inside `fetchLogHistory` before processing the response, and avoid starting history fetches from `onopen` after teardown.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: dashboard/src/components/shared/ConsoleDisplayer.vue:135


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread dashboard/src/components/shared/ConsoleDisplayer.vue
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Aug 28, 2026

@sourcery-ai sourcery-ai Bot 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.

Sourcery assessment

Approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webui The bug / feature is about webui(dashboard) of astrbot. feature:plugin The bug / feature is about AstrBot plugin system. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant