diff --git a/.project-docs/30-worklog/tasks/20260914-makelore-ppt-failure-7c4a.md b/.project-docs/30-worklog/tasks/20260914-makelore-ppt-failure-7c4a.md new file mode 100644 index 0000000..2f2417e --- /dev/null +++ b/.project-docs/30-worklog/tasks/20260914-makelore-ppt-failure-7c4a.md @@ -0,0 +1,49 @@ +# Task: Fix MakeLore failed run projection and agent default + +## Identity + +- Task ID: 20260914-makelore-ppt-failure-7c4a +- Mode: Feature +- Branch: codex/20260914-makelore-ppt-failure-7c4a-makelore-ppt-failure +- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260914-makelore-ppt-failure-7c4a +- Base commit: 9044f7dd8ce199ca57cbe0bc7be1abd1bca2a9bd +- Owner: codex-ppt-failure +- Status: Ready for Integration + +## Scope + +- Change the MakeLore cloud-agent client default `max_execution_steps` from 40 to 300 for newly materialized configuration defaults. +- Project the existing authoritative WeChat conversation run status and error visibly in the selected conversation, including historical/closed sessions and queued-only state. +- Add focused renderer/unit and consumer-seam Electron E2E regression coverage for failed runs and the required status labels. +- Keep the implementation inside MakeLore; do not change Yuxi, AgentBus, Works Square, backend contracts, billing, privacy, retry/resume controls, or published version data. + +## Intent And Constraints + +- Confirmed facts: `shared/cloud-agents.ts` defines the fallback configuration with `max_execution_steps: 40`; `electron/services/cloud-agent-operations.ts` already projects `CloudRun.status` and bounded `error.type/message`; `CloudChannelConversations` currently prioritizes the closed-session copy over run status and does not render `run.error`. +- Decision: use 300 only when the configuration field is absent. Preserve explicit saved 40/custom values and published versions because Main's configuration projection overlays present response fields. +- Decision: keep partial assistant messages, but render a prominent authoritative run-status/error block before them so partial output cannot conceal a terminal failure. +- Confirmed contract: the existing channel-conversation response includes `run.status`, `run.output`, `run.error.type/message`, and `queued_requests[].status`; Main's `projectConversation` preserves those bounded fields. Yuxi now maps the graph execution limit to `execution_step_limit` with a user-facing explanation, and its thread history already merges run/messages/queued requests. No MakeLore API change is required. +- No deployment, push, or merge is part of this task; hold the reversible commit until the independent review completes. No paid retry, automatic resume, or new framework is included. + +## Outcome + +- Completed implementation in the MakeLore client. New configuration defaults materialize at 300 execution steps while explicit saved values remain unchanged. The selected WeChat conversation now shows the authoritative run status for active, terminal, closed, and queued-only states, and shows the authoritative error before retaining any partial assistant transcript. The settings help explains that execution steps count model calls, tools, graph nodes, and middleware steps. No billing, privacy, scanner identity, published-version, retry, or resume behavior changed. +- Independent review completed with no product-executable issues and approval to commit. The reviewer confirmed the 300 default, preservation of explicit 40/custom limits and published versions, failed-run error with partial output, and queued-status precedence. + +## Verification + +- Before the fix, the component had no status/error regression assertion; closed sessions rendered only the historical-session copy and `run.error` was absent from the view. The 42 regression tests were run only against the fixed implementation; the old implementation was not executed to produce a red test. The baseline was verified from the pre-change source. The first focused test attempt was blocked by an uninstalled workspace (`vitest: command not found`), then `pnpm install --frozen-lockfile` restored the pinned dependencies. +- Passing: `pnpm exec vitest run tests/unit/cloud-channel-conversations.test.tsx tests/unit/cloud-agents-main.test.ts --maxWorkers=1` (42 tests); `pnpm run typecheck`; `pnpm exec eslint shared/cloud-agents.ts src/pages/CloudAgents/CloudChannelConversations.tsx src/pages/CloudAgents/ConfigurationFields.tsx tests/unit/cloud-agents-main.test.ts tests/unit/cloud-channel-conversations.test.tsx tests/e2e/cloud-agent-channels.spec.ts`; `pnpm run lint:check`; `pnpm run build:vite`; `pnpm run test:e2e -- tests/e2e/cloud-agent-channels.spec.ts` (1 test). `git diff --check` also passed. Build output contained only existing Browserslist, chunk-size, and dynamic-import warnings. +- Review limitation: the production WeChat E2E was not executed. The available Electron E2E and Main projection regression cover the client consumer seam; Yuxi's independent real-chain validation supplied the upstream contract confirmation. + +## Follow-ups + +- No implementation follow-up remains before integration. Keep the production WeChat E2E limitation visible when promoting this change. + +## Promotion Candidates + +- None. The default and status/error behavior are client changes covered by this task; no canonical project-memory or backend contract promotion is needed. + +## Status + +Ready for Integration diff --git a/shared/cloud-agents.ts b/shared/cloud-agents.ts index ac34a02..570ff05 100644 --- a/shared/cloud-agents.ts +++ b/shared/cloud-agents.ts @@ -48,7 +48,7 @@ export interface CloudAgentConfiguration { export const EMPTY_CLOUD_CONFIGURATION: CloudAgentConfiguration = { model: '', tools: [], knowledges: [], mcps: [], skills: [], preload_skills: [], subagents: [], - tool_approval_mode: 'default', max_execution_steps: 40, max_output_tokens: 4096, max_run_seconds: 600, + tool_approval_mode: 'default', max_execution_steps: 300, max_output_tokens: 4096, max_run_seconds: 600, }; export interface CloudAgentEntry { diff --git a/src/pages/CloudAgents/CloudChannelConversations.tsx b/src/pages/CloudAgents/CloudChannelConversations.tsx index 7dbe958..e5a4bfa 100644 --- a/src/pages/CloudAgents/CloudChannelConversations.tsx +++ b/src/pages/CloudAgents/CloudChannelConversations.tsx @@ -112,7 +112,7 @@ function ChannelSession({ sessionId, visible, refreshRevision, onBusy, onNewSess return () => { live = false; clearTimeout(timer); }; }, [sessionId, visible, revision, refreshRevision]); const runId = data?.run?.agent_run_id; - const runStatus = data?.run?.status; + const runStatus = data?.run?.status ?? data?.queued_requests?.[0]?.status; const threadId = data?.thread_id; useEffect(() => { if (!visible || !threadId) return; @@ -169,8 +169,13 @@ function ChannelSession({ sessionId, visible, refreshRevision, onBusy, onNewSess {file.is_dir ? : <>{file.name}} ); + const statusText = runStatus ? cloudStatus(runStatus) : data?.session_state === 'closed' ? '历史会话 · 可以查看消息和保存文件' : '等待微信消息'; + const runError = data?.run?.error; return
-

{data?.session_state === 'closed' ? '历史会话 · 可以查看消息和保存文件' : runStatus ? cloudStatus(runStatus) : '等待微信消息'}

+
+

任务状态:{statusText}

+ {runError?.message &&

任务错误:{runError.type ? runError.type + ' · ' : ''}{runError.message}

} +
{controllable &&
}
{pending.map(operation =>

上次会话操作的结果尚未确认。恢复会核对同一次操作。

diff --git a/src/pages/CloudAgents/ConfigurationFields.tsx b/src/pages/CloudAgents/ConfigurationFields.tsx index 9363987..7ceaddd 100644 --- a/src/pages/CloudAgents/ConfigurationFields.tsx +++ b/src/pages/CloudAgents/ConfigurationFields.tsx @@ -75,7 +75,7 @@ export function ConfigurationFields({ slug, value, disabled, onChange, section =