Skip to content

修复 Agent 会话持久化与资源边界 - #19

Merged
4evour merged 1 commit into
mainfrom
codex/pr-agent-session-safety
Aug 22, 2026
Merged

修复 Agent 会话持久化与资源边界#19
4evour merged 1 commit into
mainfrom
codex/pr-agent-session-safety

Conversation

@4evour

@4evour 4evour commented Aug 21, 2026

Copy link
Copy Markdown
Owner

变更内容

  • /agent/modify/agent/sessions 统一使用 SessionStore,移除遗留 _chat_sessions 引用。
  • 规划、聊天、修改和局部重排后显式保存会话,保证 Redis 与内存模式一致。
  • 多方案规划限制为 1–4 个受支持策略。
  • XHS 用户目录标识限制为安全字符,阻止路径逃逸。
  • 同步 XHS 抓取通过 asyncio.to_thread 移出事件循环。
  • 移除独立请求使用的无界 LangGraph 内存检查点。

行为边界

  • 多方案仅接受 balancedcultureculinarynature
  • /agent/sessions 本 PR 只修复存储访问;管理员鉴权可在后续安全 PR 中单独处理。

验证

  • py -3 tests/test_reviewed_agent_fixes.py -v:6 项通过。
  • npm run test:multi-agent:152 项通过。
  • py -3 -m ruff check api_multi_agent.py graph.py tools/session_store.py:通过。
  • git diff --cached --check:通过。

合并顺序

这是迁移栈的第 2 个 PR,基于第 1 个 PR #18。请先合并 #18,再将本 PR 的 base 调整为 main

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c4754004-500c-4bc2-af81-4b0eb31f5038

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@4evour
4evour force-pushed the codex/pr-agent-session-safety branch from 273f5f5 to f8019af Compare August 22, 2026 10:12
@4evour
4evour changed the base branch from codex/pr-api-contracts to main August 22, 2026 10:20
@4evour
4evour marked this pull request as ready for review August 22, 2026 10:20
@4evour
4evour merged commit ee60806 into main Aug 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant