Live battle updates over MCP (no polling)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- tooling
Research direction
Read server/src/types/environment.ts and the recentLogs/recentFaults buffer accessors, then inspect their emit handling and coverage to understand the existing pattern. Next, review the recent_logs and recent_faults tools in server/src/api/mcp.ts and their tests. Done means a bounded recent events buffer with sequence filtering and a matching MCP tool, covered by buffer and tool tests.
Written by the indexing model from the issue text.
Description
Instead of polling arena_status, use MCP resource-update notifications (or a recent_events buffer mirroring the recent_logs ring) so the model can follow a match as it unfolds.
Effort: M
Migrated from ENHANCEMENTS.md (§6 AI / MCP integration).
Implementation notes
Priority: medium — Improves MCP agent ergonomics and reduces polling load, but it's an AI-tooling nicety on a non-core path, not a stability/security fix or a change touched by most human users.
Purpose
An AI agent driving a match today must repeatedly call arena_status/match_status (server/src/api/mcp.ts) to see what changed, burning tool-call budget and adding latency between "tank moved" and the model noticing. A push-style or ring-buffer alternative lets an agent react to hits/eliminations/faults promptly without hammering the tool, improving MCP agent UX and reducing load on EnvironmentService/buildArenaStatus.
Implementation approach
- The realistic path is the
recent_logs/recent_faultsring-buffer pattern, not true MCP resource-update push:POST /api/mcp(server/src/api/mcp.ts~line 1304-1311) builds a freshStreamableHTTPServerTransport({ sessionIdGenerator: undefined })andMcpServerper request and tears both down onres.on('close')— this is explicitly stateless, so there is no persistent session/transport to callserver.sendResourceUpdated()/notifications/resources/updatedon later. Real server push would require moving to a stateful session (sessionIdGenerator + kept-alive transport), a materially bigger change than this issue's stated effort. - Add a
recentEventsring buffer toEnvironment(server/src/types/environment.ts), mirroringrecentLogs/recentFaultsexactly: aMAX_RECENT_EVENTScap, populated inemit()wheneventName === 'event'(same spot that already special-cases'log'), with agetRecentEvents(limit?, sinceSeq?)accessor. - Add a corresponding
recent_eventsMCP tool inmcp.tsnext torecent_logs/recent_faults, following their filter/limit/ownedArenapattern, plus optionally a matchingGET .../arena/recent-eventsREST route inapi/arena.tsfor parity with/logs. - Give each buffered event a monotonic
seq(fromenv.getTime()tick or an incrementing counter) so a caller can passsinceSeqand get only new events — this is the "no polling" win: one cheap diff-fetch instead of re-diffing fullarena_status.
Key details to plan
- No DB changes — buffer is in-memory on
Environment, same lifecycle asrecentLogs/recentFaults(lost on the 30-min environment dispose or process restart); note #142 (no migrations) is irrelevant here. - Determinism/PRNG unaffected — this only taps the existing
emitter.emit('event', ...)call sites already used for SSE; no simulation math changes, sosimulation.ts/simulate.tsdo not need touching. - Bot-facing
compiler.tsAPI is untouched — this is purely an MCP/host-side observability feature. - Testing: extend
environment-level tests (or add one) for the new ring buffer/eviction behavior alongside the existingrecentLogs/recentFaultscoverage; extendserver/test/api.test.ts-style MCP tool tests forrecent_eventsinput validation and filtering, mirroringrecent_logs. - Effort/risk: matches the stated M — low risk if scoped to the ring-buffer approach; flag in the issue that true MCP push notifications are a separate, larger effort blocked on making
/api/mcpstateful.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 8m
- Merged PRs (30d)
- 8
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LeeAdcock/robocodeJs.com
-
priority: medium tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
LeeAdcock/robocodeJs.com#411 ·
Maintainers usually reply within 1 day
-
enhancement priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LeeAdcock/robocodeJs.com#254 ·
Maintainers usually reply within 1 day
-
good first issue priority: low tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
LeeAdcock/robocodeJs.com#146 ·
Maintainers usually reply within 1 day
-
dependencies priority: low tech-debt
Difficulty 1/5 Under an hour Newbie friendliness 15/100
LeeAdcock/robocodeJs.com#413 ·
Maintainers usually reply within 1 day
-
priority: low tech-debt
Difficulty 3/5 Half a day Newbie friendliness 32/100
LeeAdcock/robocodeJs.com#412 ·
Maintainers usually reply within 1 day
All issues in LeeAdcock/robocodeJs.com
Similar issues
-
ai-driven-qa bug claude Minor
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
linagora/twake-contacts-frontend#241 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
ui(ListToolbar): search takes the full row on a phone instead of sharing it with the result countOpen
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
priority:high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ahmedkhaleel2004/gitdiagram#228 ·