📊 sunnypoint
Dev Log

[2026-07-Diary]

8 min read

Today, I focused on porting the HTML report output and serving system from the upstream repository to our fork, which has been a long-pending major feature for my AI investment assistant project. Along with that, I also fundamentally resolved the domestic news feed issue and MCP server crash problems reported by users.

Completed Porting of HTML Report Output and PDF Storage Function

For a while now, our version was missing the HTML report storage and serving related code that was added in upstream. This caused chronic problems where the report storage function didn't work properly or showTab related errors occurred in the viewer screen. To solve this, I conducted a major 5-step porting process.

First, I built a router on the backend that serves HTML documents and converts them to PDF on the fly. I set it up to convert HTML to clean PDF files using the Playwright library, and then provided options for users to directly choose their preferred output format between markdown and HTML in the settings page.

On the frontend, I reconstructed a dedicated viewer module to serve dynamically built HTML in an isolated sandbox and smoothly connected the download and PDF conversion action buttons. In this process, I also ported our fork's strength - the external CDN script error preservation logic (injectCrossOrigin) - to the upstream shared module to maintain consistency.

Finally, I tested by requesting a comparative analysis report for the three major entertainment companies (HYBE, JYP, YG) in HTML format. I confirmed that the report was perfectly built as a 43KB HTML file with neat charts and snapshot cards, and empirically demonstrated that it was successfully converted and saved as a 7-page PDF document with fully included charts through Playwright, completing the full-stack live verification. I also learned the lesson that the Playwright Chromium browser installation command must be executed in the deployment environment.

Fixed Domestic News Feed Integration Issues

I focused on analyzing the reasons why domestic news collection was not working smoothly in user logs.

First, for the Il-dae-ili RSS service, the previously used RSS URL endpoint had been officially deprecated and was redirecting to the Il-dae-ili homepage HTML. Because of this, the program couldn't parse XML and was constantly filling the error logs. To solve this, I replaced it with a new real-time stock news RSS feed address, confirming 50 successful parsing cases.

For Maeil Business Newspaper, I discovered that requests were being blocked due to Cloudflare's bot detection challenge. The reason was that I was creating a new HTTP client for each request, so cookies weren't being maintained, and I was requesting with an agent bot name instead of a browser. I plan to improve this by implementing UA application that mimics browser information and cookie reuse logic in the future. For now, I added a guard to lightly block warning logs to improve log cleanliness, preventing unnecessary parsing error logs from flooding when HTML responses come in.

Resolved MCP Server Startup Failure and Wrapping Up

Lastly, I tracked the cause of the 3 MCP servers that handle price, financial, and macro data - the core of the investment assistant - losing connection immediately after startup.

The cause was that when spawning child processes, the repository root and source path couldn't be set, so it couldn't import internal utility modules and crashed. I solved this by modifying the server launch function to explicitly inherit the project root directory path in the child process's PYTHONPATH environment variable. Thanks to this, now 21 servers and 126 tools are fully integrated and waiting in standby mode without connection failures.

All changes have been pushed to my personal fork repository, separated into individual feature branches. Now I plan to sequentially review the remaining report sharing link generation and challenge mitigation logic.

Today's Thoughts

When fetching data from the upstream repository, it's consuming more time and tokens than I expected, and I have a lot of concerns. After merging like this, many cases where errors occur in parts I didn't think of also happen...

#dev-diary

Comments

💬 GitHub Discussions comment widget (Giscus integration pending)