FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
fix(pr-review): address 7 feedback items from manager review
Abhi Kakadiya11415282bb1e
diff --git a/fincept-qt/src/python/PythonRunner.cpp b/fincept-qt/src/python/PythonRunner.cppindex f9075dcaf..84cc0063c 100644--- a/fincept-qt/src/python/PythonRunner.cpp+++ b/fincept-qt/src/python/PythonRunner.cpp@@ -302,55 +302,12 @@ QString PythonRunner::find_scripts_dir() const {// ── Run Script ───────────────────────────────────────────────────────────────-bool PythonRunner::route_yfinance_to_daemon(const QStringList& args, Callback cb) {- if (!is_available()) return false;-- if (args.isEmpty()) return false;- const QString action = args[0];- QJsonObject payload;-- if (action == "quote" || action == "info" || action == "news" || action == "financials" || action == "company_profile") {- if (args.size() > 1) payload["symbol"] = args[1];- if (action == "news" && args.size() > 2) payload["count"] = args[2].toInt();- } else if (action == "batch_quotes" || action == "batch_sparklines" || action == "multiple_profiles" || action == "multiple_ratios") {- QJsonArray syms;- for (int i = 1; i < args.size(); ++i) syms.append(args[i]);- payload["symbols"] = syms;- } else if (action == "historical_period") {- if (args.size() > 1) payload["symbol"] = args[1];- if (args.size() > 2) payload["period"] = args[2];- if (args.size() > 3) payload["interval"] = args[3];- } else if (action == "search") {- if (args.size() > 1) payload["query"] = args[1];- } else {- return false; // Action not supported or requires subprocess- }-- PythonWorker::instance().submit(action, payload, [cb](bool ok, QJsonObject result, QString error) {- PythonResult r;- r.success = ok;- r.error = error;- if (ok) {- r.output = QString::fromUtf8(QJsonDocument(result).toJson(QJsonDocument::Compact));- }- cb(r);- });-- return true;-}-void PythonRunner::run(const QString& script, const QStringList& args, Callback cb, StreamCallback on_line) {if (python_init_done_ && python_path_.isEmpty()) {cb({false, {}, "Python not available — run first-time setup from the app", -1});return;}- if (script == QLatin1String("yfinance_data.py")) {- if (route_yfinance_to_daemon(args, cb))- return;- // falls through to normal subprocess queue below- }-QString script_path = scripts_dir_ + "/" + script;if (!QFileInfo::exists(script_path)) {cb({false, {}, "Script not found: " + script_path, -1});diff --git a/fincept-qt/src/python/PythonRunner.h b/fincept-qt/src/python/PythonRunner.hindex bd9ff5377..0cc2f7ef3 100644--- a/fincept-qt/src/python/PythonRunner.h+++ b/fincept-qt/src/python/PythonRunner.h@@ -67,7 +67,6 @@ class PythonRunner : public QObject {void python_ready();private:- bool route_yfinance_to_daemon(const QStringList& args, Callback cb);PythonRunner();QString find_python_sync() const;void find_python_async();diff --git a/fincept-qt/src/python/PythonWorker.cpp b/fincept-qt/src/python/PythonWorker.cppindex 46e6a36b5..4aa49ddf8 100644--- a/fincept-qt/src/python/PythonWorker.cpp+++ b/fincept-qt/src/python/PythonWorker.cpp@@ -120,7 +120,6 @@ void PythonWorker::launch_process() {python_exe = runner.python_path();if (python_exe.isEmpty()) {LOG_WARN("PythonWorker", "No Python interpreter resolved — worker disabled");- QTimer::singleShot(500, this, [this]() { ensure_started(); });return;}diff --git a/fincept-qt/src/screens/ai_chat/AiChatScreen.cpp b/fincept-qt/src/screens/ai_chat/AiChatScreen.cppindex 2f14c6a71..dc727efda 100644--- a/fincept-qt/src/screens/ai_chat/AiChatScreen.cpp+++ b/fincept-qt/src/screens/ai_chat/AiChatScreen.cpp@@ -134,11 +134,8 @@ void AiChatScreen::refresh_theme() {void AiChatScreen::showEvent(QShowEvent* e) {QWidget::showEvent(e);- // Connect LlmService finished_streaming to handle streaming responses using request‑time contextconnect(&ai_chat::LlmService::instance(), &ai_chat::LlmService::finished_streaming,this, &AiChatScreen::on_streaming_done, Qt::UniqueConnection);- // No additional code needed here.-connect(&ai_chat::LlmService::instance(), &ai_chat::LlmService::config_changed, this,&AiChatScreen::on_provider_changed, Qt::UniqueConnection);// Phase 7: rehydrate the linked symbol from SymbolContext on everydiff --git a/fincept-qt/src/screens/ai_chat/AiChatScreen_Messaging.cpp b/fincept-qt/src/screens/ai_chat/AiChatScreen_Messaging.cppindex 6f9062356..929f0bcd1 100644--- a/fincept-qt/src/screens/ai_chat/AiChatScreen_Messaging.cpp+++ b/fincept-qt/src/screens/ai_chat/AiChatScreen_Messaging.cpp@@ -139,6 +139,7 @@ void AiChatScreen::on_send() {pending_req_session_ = req_session;pending_req_provider_ = req_provider;pending_req_model_ = req_model;+ input_box_->clear();input_box_->setFixedHeight(44);set_input_enabled(false);streaming_ = true;@@ -215,18 +216,8 @@ void AiChatScreen::on_stream_chunk(const QString& chunk, bool done) {void AiChatScreen::on_streaming_done(ai_chat::LlmResponse response) {streaming_ = false;- // Clear pending request context early to avoid stale data on error paths- pending_req_session_.clear();- pending_req_provider_.clear();- pending_req_model_.clear();show_typing(false);-- // Ensure a bubble exists for any terminal state (success + content,- // failure with an error message, or success-but-empty). Without this,- // a kimi/openai response that arrives via the non-streaming fallback- // with no per-chunk emission, or fails before any chunk lands, would- // be silently dropped — the typing indicator hides and the input is- // re-enabled but nothing is shown.+// Ensure a bubble exists for any terminal state (success + content,// failure with an error message, or success-but-empty). Without this,// a kimi/openai response that arrives via the non-streaming fallback