agentscope-ai / agentscope-ai/QwenPaw

[Feature]: Restore the native context strategy option in the web UI (scroll prompt is too heavy)

Abierto
#7,058 1 comentario 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Python
Estrellas
34.9k
Forks
3.1k
Merge medio
1 d 15 h
PR fusionados (30 d)
225

Descripción

## Summary

v2.1.0 removed the context-strategy selector (scroll / native) from the console, so users are locked into `scroll`. The backend still fully supports `native` (`LightContextConfig.strategy: Literal["native", "scroll"]`), but there is no longer any UI — or documented — way to choose it. Please restore the `native` option, or, if it is being deprecated, provide a lighter-weight scroll prompt.

## 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
- [ ] Documentation (website)
- [ ] Tests
- [ ] CI/CD
- [ ] Scripts / Deploy

## Problem / Motivation

1. **`native` is still useful.** It is the lightweight strategy (AgentScope's built-in compression) with no extra system prompt. For single-session tasks, or users who do not need durable cross-session recall, `native` is simpler, faster, and more predictable.

2. **`scroll` injects a very large system prompt.** `src/qwenpaw/agents/context/scroll/prompt.py` (`SCROLL_SYSTEM_PROMPT` / `SCROLL_SYSTEM_PROMPT_ZH`) is ~96 lines / ~930 words, covering the `⟦ headline ⟧` format, the `[context compressed]` map, `recall_history` usage, and a long DISCIPLINE block. This consumes a meaningful share of the context budget and, more importantly, adds heavy instruction-following overhead that can distract or over-constrain the model — especially for smaller/faster models or simple tasks that do not benefit from it.

3. After commit `734c8b9f` (#6323) removed the selector from `console/src/pages/Agent/Config/components/ReactAgentCard.tsx`, there is no in-UI opt-out: every agent pays the scroll overhead by default.

## Proposed Solution

**Option A (preferred):** restore the `light_context_config.strategy` selector (scroll / native) in the console, e.g. in `ReactAgentCard` or `LightContextCard`.

**Option B:** if `native` is on a deprecation path, keep the selector but clearly mark `native` as legacy and document a migration path.

**Option C (minimum):** keep the strategy configurable and document `light_context_config.strategy` in `config.json` (it already works, but is hidden and requires a restart), and/or trim the scroll system prompt into a small mandatory core plus optional detail.

## Alternatives Considered

- Manually setting `light_context_config.strategy = "native"` in `config.json` works today, but requires a restart and is undocumented — not discoverable for most users.

## Additional Context

- QwenPaw version: 2.1.0 (the removal landed between 2.0.1 and 2.1.0).
- Removing commit: `734c8b9f` — "feat(scroll): add staged compaction and durable task continuity (#6323)".
- The i18n keys `agentConfig.contextStrategyScroll` / `agentConfig.contextStrategyNative` still exist in the locale files but are now orphaned (no component renders them), which suggests the selector was removed without fully deprecating `native`.

## Willing to Contribute

- [ ] I am willing to open a PR for this feature (after discussion).

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.