forked from bai/curriculum-project-hub
fix: hide per-run cost from Feishu replies
This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@paradigm/hub",
|
"name": "@paradigm/hub",
|
||||||
"version": "0.0.13",
|
"version": "0.0.14",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@paradigm/hub",
|
"name": "@paradigm/hub",
|
||||||
"version": "0.0.13",
|
"version": "0.0.14",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@anthropic-ai/claude-agent-sdk": "^0.3.202",
|
"@anthropic-ai/claude-agent-sdk": "^0.3.202",
|
||||||
"@fastify/cookie": "^11.0.2",
|
"@fastify/cookie": "^11.0.2",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@paradigm/hub",
|
"name": "@paradigm/hub",
|
||||||
"version": "0.0.13",
|
"version": "0.0.14",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import type { RuntimeSettings } from "../settings/runtime.js";
|
|||||||
import { currentLockRunId, releaseLock } from "../lock.js";
|
import { currentLockRunId, releaseLock } from "../lock.js";
|
||||||
import { createPermissionAuthorizer, type AuthorizationDecision, type PermissionAuthorizer } from "../permission.js";
|
import { createPermissionAuthorizer, type AuthorizationDecision, type PermissionAuthorizer } from "../permission.js";
|
||||||
import { writeAudit } from "../audit.js";
|
import { writeAudit } from "../audit.js";
|
||||||
import { formatRunCostLine } from "../agent/cost.js";
|
|
||||||
import { createAgentSdkStderrSink } from "../agent/diagnostics.js";
|
import { createAgentSdkStderrSink } from "../agent/diagnostics.js";
|
||||||
import { InactiveOrganizationError, lockActiveOrganization } from "../org/status.js";
|
import { InactiveOrganizationError, lockActiveOrganization } from "../org/status.js";
|
||||||
import { StreamingAgentCard } from "./card/streaming-card.js";
|
import { StreamingAgentCard } from "./card/streaming-card.js";
|
||||||
@@ -550,7 +549,7 @@ export function makeTriggerHandler(deps: TriggerDeps): TriggerHandler {
|
|||||||
: result.status === "failed" && result.error !== undefined
|
: result.status === "failed" && result.error !== undefined
|
||||||
? `\u5904\u7406\u5931\u8D25: ${result.error}`
|
? `\u5904\u7406\u5931\u8D25: ${result.error}`
|
||||||
: result.text;
|
: result.text;
|
||||||
await card.finish(finalText, { interrupted, footerText: formatRunCostLine(result.costUsd) });
|
await card.finish(finalText, { interrupted });
|
||||||
const metadataPatch = sessionMetadataPatch(result.sdkSessionId);
|
const metadataPatch = sessionMetadataPatch(result.sdkSessionId);
|
||||||
if (metadataPatch !== null) {
|
if (metadataPatch !== null) {
|
||||||
await deps.prisma.agentSession.update({
|
await deps.prisma.agentSession.update({
|
||||||
|
|||||||
@@ -168,7 +168,8 @@ describe("trigger full lifecycle (integration)", () => {
|
|||||||
msgType: "interactive",
|
msgType: "interactive",
|
||||||
replyInThread: undefined,
|
replyInThread: undefined,
|
||||||
});
|
});
|
||||||
expect(rt.sentTexts.some((text) => text.includes("mock response") && text.includes("本次成本: $0.0023"))).toBe(true);
|
expect(rt.sentTexts.some((text) => text.includes("mock response"))).toBe(true);
|
||||||
|
expect(rt.sentTexts.some((text) => text.includes("本次成本"))).toBe(false);
|
||||||
expect(runAgentCalls).toHaveLength(1);
|
expect(runAgentCalls).toHaveLength(1);
|
||||||
expect(runAgentCalls[0]?.providerProxyEnv).toMatchObject({
|
expect(runAgentCalls[0]?.providerProxyEnv).toMatchObject({
|
||||||
ANTHROPIC_BASE_URL: "http://127.0.0.1:12345",
|
ANTHROPIC_BASE_URL: "http://127.0.0.1:12345",
|
||||||
|
|||||||
Reference in New Issue
Block a user