feat(soul): agent logic upgrade - #149
Merged
Merged
Conversation
Contributor
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR adds three new agent tools ( ChangesAgent loop observability, new tools, and context management
Sequence Diagram(s)sequenceDiagram
participant PythinkerSoul
participant AgentListInjectionProvider
participant BudgetNudge
participant MemoryHarvest
participant Wire
PythinkerSoul->>AgentListInjectionProvider: get_injections(history, soul)
AgentListInjectionProvider->>Wire: send AgentListDelta (if fingerprint changed)
AgentListInjectionProvider-->>PythinkerSoul: list[DynamicInjection]
PythinkerSoul->>BudgetNudge: _crossed_budget_nudge_threshold(before, after, ceiling, ratio)
BudgetNudge-->>PythinkerSoul: True / False
PythinkerSoul->>PythinkerSoul: append _budget_nudge_message to context
PythinkerSoul->>MemoryHarvest: _harvest_on_stop(history_start_index)
MemoryHarvest->>MemoryHarvest: append_scratch_note for each harvested note
MemoryHarvest->>AgentListInjectionProvider: rearm("project_memory")
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested labels
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
Add wire events for todo updates, tool skips, subagent fallback, agent-list deltas, and overflow recovery. Wire opt-in ToolUseSkipped telemetry, AgentList injection, budget nudge, microcompact pruning, ToolSearch discovery, session worktree enter/exit, and opt-in harvest-on-stop memory capture. Update changelog, architecture docs, and tests.
Add opt-in emits_tool_use_skipped hook for cross-step duplicate visibility, pin exclusive default for unflagged plugin tools, and document the gate contract.
Drop duplicate budget-nudge, ToolUseSkipped emit paths, and conflicting tests introduced when merging feat/blackbox-agent-loop-port into main.
elkaix
force-pushed
the
agent-logic-upgrade
branch
from
June 15, 2026 14:36
1d76d0b to
c17ac9c
Compare
…istDelta wire events
…upgrade 4 files were unformatted (ruff would-reformat). 5 e2e snapshot tests were stale after new slash commands (/recap, /accept-edits, /goal, /learn, /best-practices) and skill entries were added to the wire initialize handshake.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
- ci-pythinker-host.yml: add workflow-level `permissions: contents: read` - llm.py: use urlparse hostname check instead of substring match for dashscope and workspace endpoint detection (prevents false positives from path segments) - dependencies.py: remove duplicate '=' from _VERSION_PREFIX_RE character class - test_memory_phase_bcd.py: consolidate to single import style for pythinkersoul module - test_toolset.py: replace standalone awaits with gather/assignment forms - test_toolset_concurrency.py: remove always-true redundant assertion - examples/feedback-worker/index.ts: replace .+? with [^<]*? to prevent ReDoS
CodeQL flagged the angle-bracket regex in the feedback-worker example as a polynomial regular expression on uncontrolled header input. Replace it with an indexOf/slice parse that is linear in input length while preserving the "Name <addr>" parsing behavior.
4 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TodoListUpdated,SubagentToolFallback,AgentListDelta,ToolUseSkipped,ContextOverflowRecovered), opt-in token-budget nudge, and context-overflow recovery signaling.ToolSearch,EnterWorktree,ExitWorktree) and opt-in stop-time memory extraction viamemory.harvest_on_stop.main, resolve duplicate merge paths, and refresh tests/snapshots for the updated wire and fail-fast semantics.Test plan
make check-pythinker-codemake test-pythinker-codemake test(or targeted e2e wire snapshot tests if full suite is too slow)Made with Cursor
Summary by CodeRabbit
New Features
Improvements
Observability