Skip to content

🪲 BUG-#63: Wire Agent.on_request in serve.py - #66

Merged
FernandoCelmer merged 2 commits into
masterfrom
feature/63
Aug 16, 2026
Merged

🪲 BUG-#63: Wire Agent.on_request in serve.py#66
FernandoCelmer merged 2 commits into
masterfrom
feature/63

Conversation

@FernandoCelmer

Copy link
Copy Markdown
Member

Description

  • pycodeloop/cli/serve.py — Wires `agent.on_request`, forwarding it as a `chat/request` notification (`{messageCount, toolCount}`), mirroring how `run`/`chat` use the same hook for their "N msg in context, M tools available…" status line.

Motivation and Context

`Agent.on_request` is called once per turn right before the provider call and is already wired in `cli/flow.py` (terminal run) and `cli/chat.py` (interactive TUI), but never in `serve.py` — the only entry point the VSCode plugin talks to. It's a display-only hook (no message-loss impact on its own — the compaction path this was originally flagged against is already fixed independently in #65, since `_compact()` now reads via `session.history()` directly), but leaving it unwired was inconsistent with every other CLI entry point exposing the same signal to its client.

Closes #63.

Types of changes

  • Bug fix (change that fixes an issue)
  • New feature
  • Documentation

Checklist

  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective
  • I have updated the CHANGELOG
  • I have updated the documentation accordingly

@FernandoCelmer FernandoCelmer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Code Review

Code issues found: 1

# Severity Comment
1 [Suggestion] Missing test for chat/request notification

Comment thread pycodeloop/cli/serve.py
@FernandoCelmer FernandoCelmer added the bug Something isn't working label Aug 16, 2026
@FernandoCelmer
FernandoCelmer merged commit 40a01c5 into master Aug 16, 2026
8 checks passed
@FernandoCelmer
FernandoCelmer deleted the feature/63 branch August 16, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent.on_request callback never wired in serve.py

1 participant