agentscope-ai / agentscope-ai/QwenPaw
[Feature]: Add an Agent-level cross-session recall toggle for Scroll
- Lenguaje dominante
- Python
- Estrellas
- 34.9k
- Forks
- 3.1k
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 225
Descripción
## Summary
Add an Agent-level Scroll setting that controls whether a new session may recall other sessions, while preserving durable history, current-session multi-turn context, compaction, and exact recovery.
Proposed configuration:
```json
{
"light_context_config": {
"strategy": "scroll",
"scroll_config": {
"cross_session_recall_enabled": false
}
}
}
```
The default should remain `true` for backward compatibility.
## Component(s) Affected
- [x] Core / Backend (app, agents, config, providers, utils, local_models)
- [x] Console (frontend web UI)
- [ ] Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
- [ ] Skills
- [ ] CLI
- [x] Documentation (website)
- [x] Tests
- [ ] CI/CD
- [ ] Scripts / Deploy
## Problem / Motivation
Scroll intentionally recalls history from the same Agent across all sessions. This is valuable for general assistants, but it is too broad for specialized Agents whose sessions must remain independent.
Switching the Agent to `native` is not an equivalent solution: it also removes Scroll's durable write-through history, current-session compaction index, and exact recovery of earlier turns and tool results.
The needed product boundary is narrower:
- keep writing the conversation to `history.db`;
- keep normal multi-turn behavior in the current session;
- keep current-session recovery after compaction;
- prevent a new session from reading another session unless explicitly enabled.
## Proposed Solution
Add `scroll_config.cross_session_recall_enabled: bool = true` and expose it in the Agent context settings as:
> Allow recall from other sessions
When disabled:
1. `recall_history(op="search")` is restricted to the current `session_id` and current `agent_id`.
2. An explicit different `session_id`, different `agent_id`, or `all_agents=true` is rejected by the tool execution layer.
3. `recall_tool` is restricted to the current session and Agent.
4. `recall_history_python` is not registered. Its raw read-only SQL access cannot be safely reduced to a session boundary by prompt instructions alone.
5. The Scroll system prompt states that only current-session history is available and asks the model to request missing information again.
6. No history is deleted. Re-enabling the setting restores the existing cross-session behavior.
The restriction should be enforced in code as well as described in the prompt.
## Non-goals
- This setting does not change ReMeLight semantic memory.
- It does not disable Skills or business Plugin tools.
- It is a Scroll recall policy, not a complete confidentiality boundary against arbitrary Shell or file tools that can directly read workspace files. Path-level protection can be addressed separately.
## Acceptance Criteria
- [ ] New turns continue to be written to `history.db`.
- [ ] After compaction, the current session can still expand earlier turns and recover its own tool results.
- [ ] A new session cannot search or retrieve a previous session when the setting is disabled.
- [ ] Other `session_id` values, other `agent_id` values, and `all_agents=true` are denied.
- [ ] Tool results from another session cannot be recalled.
- [ ] `recall_history_python` is unavailable while cross-session recall is disabled.
- [ ] Re-enabling the setting restores the existing behavior without data migration.
- [ ] Saving the option in Console reloads only the selected Agent.
## Related Work
- #5321 introduced Scroll and intentionally scoped default recall to the same Agent across all sessions.
- #6299 addressed unintended cross-session contamination and demonstrates the importance of strict session scoping for recovery paths.
- #7058 proposes restoring the coarse `native`/Scroll selector. This request is complementary: it keeps Scroll and controls only cross-session recall.
## Willing to Contribute
- [x] I am willing to open a PR for this feature after maintainer feedback.
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.