Skip to content

[Feature]: Nudge counters reset on /new — self-improvement never triggers for short-session users #18369

@Hubedge

Description

@Hubedge

Problem or Use Case

Users who habitually start fresh sessions with /new every 1–3 turns will find that the memory nudge and skill nudge background review mechanisms never trigger.

Root cause: both counters (_turns_since_memory, _iters_since_skill) are instance variables on AIAgent, initialized to 0 in __init__. /new creates a brand-new AIAgent instance → counters reset to zero.

Impact:

  • Memory nudge: requires 10 user turns within the same session (memory.nudge_interval defaults to 10). Frequent /new users never reach 10.
  • Skill nudge: requires 10 tool-calling iterations within the same session (skills.creation_nudge_interval defaults to 10). Likewise never reached.

System prompt guidance (MEMORY_GUIDANCE, SKILLS_GUIDANCE) still exists and can prompt the model to proactively use these tools, but the post-turn "review the conversation above and consider saving" prompt never fires, so the practical effect is severely reduced.

Result: for heavy /new users, the self-improvement mechanisms are effectively dead — the memory store barely grows, and the skill library depends entirely on manual maintenance.

Proposed Solution

This is an open discussion. Known facts and constraints for reference:

Should nudge state persist across sessions? If so, what mechanism (session DB, file-based counter, time-decay)? Should /new itself trigger a review before discarding the old session? Could the nudge be time-based in addition to turn-based?

Would love to hear more use cases and ideas.

Alternatives Considered

(Left open for discussion)

Feature Type

Performance / reliability

Scope

Medium (few files, < 300 lines)

Contribution

  • I'd like to implement this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/agentCore agent loop, run_agent.py, prompt buildertype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions