Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Live battle updates over MCP (no polling)

Open
#134 0 comments 0 reactions 0 assignees View on GitHub

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

ai-mcp enhancement priority: medium

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_faults ring-buffer pattern, not true MCP resource-update push: POST /api/mcp (server/src/api/mcp.ts ~line 1304-1311) builds a fresh StreamableHTTPServerTransport({ sessionIdGenerator: undefined }) and McpServer per request and tears both down on res.on('close') — this is explicitly stateless, so there is no persistent session/transport to call server.sendResourceUpdated()/notifications/resources/updated on 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 recentEvents ring buffer to Environment (server/src/types/environment.ts), mirroring recentLogs/recentFaults exactly: a MAX_RECENT_EVENTS cap, populated in emit() when eventName === 'event' (same spot that already special-cases 'log'), with a getRecentEvents(limit?, sinceSeq?) accessor.
  • Add a corresponding recent_events MCP tool in mcp.ts next to recent_logs/recent_faults, following their filter/limit/ownedArena pattern, plus optionally a matching GET .../arena/recent-events REST route in api/arena.ts for parity with /logs.
  • Give each buffered event a monotonic seq (from env.getTime() tick or an incrementing counter) so a caller can pass sinceSeq and get only new events — this is the "no polling" win: one cheap diff-fetch instead of re-diffing full arena_status.
Key details to plan
  • No DB changes — buffer is in-memory on Environment, same lifecycle as recentLogs/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, so simulation.ts/simulate.ts do not need touching.
  • Bot-facing compiler.ts API 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 existing recentLogs/recentFaults coverage; extend server/test/api.test.ts-style MCP tool tests for recent_events input validation and filtering, mirroring recent_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/mcp stateful.
Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
8m
Merged PRs (30d)
8

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LeeAdcock/robocodeJs.com

All issues in LeeAdcock/robocodeJs.com

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.