@yeaft/webchat-agent 1.0.448 → 1.0.450

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Dockerfile CHANGED
@@ -5,10 +5,15 @@ ENV NODE_ENV=production \
5
5
  HOME=/home/yeaft \
6
6
  YEAFT_DIR=/home/yeaft/.yeaft \
7
7
  WORK_DIR=/workspace \
8
- YEAFT_AGENT_RUNTIME=container_agent
8
+ YEAFT_AGENT_RUNTIME=container_agent \
9
+ VIRTUAL_ENV=/opt/yeaft-python \
10
+ PATH=/opt/yeaft-python/bin:$PATH
9
11
 
10
12
  RUN apt-get update \
11
- && apt-get install -y --no-install-recommends ca-certificates git openssh-client tini \
13
+ && apt-get install -y --no-install-recommends ca-certificates curl git openssh-client python3 python3-venv tini wget \
14
+ && python3 -m venv "$VIRTUAL_ENV" \
15
+ && "$VIRTUAL_ENV/bin/pip" install --no-cache-dir "akshare==1.18.91" \
16
+ && "$VIRTUAL_ENV/bin/python" -c "import akshare; assert akshare.__version__ == '1.18.91'; assert all(hasattr(akshare, name) for name in ('stock_info_global_em', 'futures_display_main_sina', 'futures_zh_spot'))" \
12
17
  && rm -rf /var/lib/apt/lists/* \
13
18
  && useradd --create-home --uid 10001 --shell /usr/sbin/nologin yeaft \
14
19
  && mkdir -p /app /workspace /home/yeaft/.yeaft \
@@ -1 +1 @@
1
- {"version":"1.0.448"}
1
+ {"version":"1.0.450"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "1.0.448",
3
+ "version": "1.0.450",
4
4
  "description": "Remote worker agent for Yeaft Web Code Agent — connects the native Yeaft engine, CLI providers, and workbench tools",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -2096,15 +2096,25 @@ async function routeEnvelopeToVpThread(sessionId, vpId, envelope) {
2096
2096
  } else if (runningThreads.length === 0) {
2097
2097
  thread = getOrCreateVpThread({ sessionId, vpId, title: fallbackTitle(text) });
2098
2098
  } else {
2099
- const decision = await threadClassifier({
2100
- adapter: session?.adapter,
2101
- model: session?.config?.fastModel || session?.config?.model,
2102
- vp: readVpForClassifier(vpId),
2103
- runningThreads: runningThreads.map(threadSnapshotForClassifier),
2104
- newQuery: text,
2105
- });
2106
- const targetIsRunning = runningThreads.some((t) => t.threadId === decision.targetThreadId);
2107
- if (decision.decision === 'related' && decision.targetThreadId && targetIsRunning) {
2099
+ let decision = null;
2100
+ try {
2101
+ decision = await threadClassifier({
2102
+ adapter: session?.adapter,
2103
+ model: session?.config?.fastModel || session?.config?.model,
2104
+ vp: readVpForClassifier(vpId),
2105
+ runningThreads: runningThreads.map(threadSnapshotForClassifier),
2106
+ newQuery: text,
2107
+ });
2108
+ } catch (err) {
2109
+ // Classification is an optimisation, not a delivery boundary. The user
2110
+ // message is already durable at this point; dropping the rejected route
2111
+ // promise would leave it visible in history without ever starting a turn.
2112
+ console.warn('[Yeaft] VP thread classification failed; starting a new thread:', err?.message || err);
2113
+ }
2114
+ const targetIsRunning = decision
2115
+ ? runningThreads.some((t) => t.threadId === decision.targetThreadId)
2116
+ : false;
2117
+ if (decision?.decision === 'related' && decision.targetThreadId && targetIsRunning) {
2108
2118
  thread = getOrCreateVpThread({
2109
2119
  sessionId,
2110
2120
  vpId,
@@ -2116,7 +2126,7 @@ async function routeEnvelopeToVpThread(sessionId, vpId, envelope) {
2116
2126
  thread = getOrCreateVpThread({
2117
2127
  sessionId,
2118
2128
  vpId,
2119
- title: decision.title || fallbackTitle(text),
2129
+ title: decision?.title || fallbackTitle(text),
2120
2130
  });
2121
2131
  }
2122
2132
  }