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

MCP cost rows: derive the asserted field list from CostRow so a dropped field fails

Open Beginner friendly
#759 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
testing

Research direction

Read tokenjam/mcp/server.py and the parity tests, especially test_get_cost_summary_http_mode_preserves_complete_rows and _proj_cost. Start by examining how those tests currently enumerate CostRow fields; use dataclasses.fields(CostRow) as the issue directs. Done when adding a field to CostRow and the REST route but omitting it from the MCP serializer makes at least one test fail.

Written by the indexing model from the issue text.

Description

enhancement good first issue help wanted

tokenjam/mcp/server.py's cost-row serializer and _HttpDB both enumerate CostRow's fields by hand, so a field added to CostRow and to the REST route can be dropped by MCP with nothing failing. That is the exact shape of #565, which this would let recur.

Established by experiment during the #751 review. Two directions:

A — the _HttpDB half IS gated. Added reasoning_tokens: int = 0 to CostRow, wired it into the REST /cost row dict and the MCP serializer, deliberately not into _HttpDB. Result: test_get_cost_summary_http_mode_preserves_complete_rows fails. Good.

B — the serializer half is NOT. Same field on CostRow and the REST route, omitted from the MCP serializer (and _HttpDB). Result: 80 passed across test_mcp_server.py, test_storage_backend_parity.py and test_data_access_parity.py. Nothing fails, and MCP silently under-reports.

B is #565 happening again. The reason A catches anything is incidental — the hand-written fake_response lacks the field, so _HttpDB not setting it makes the serializer raise. Neither test is actually checking coverage of CostRow.

_proj_cost in the parity test has the same weakness: r.call_count is appended by hand, so it drifts identically.

Fix direction: derive the asserted field list from dataclasses.fields(CostRow) in both test_get_cost_summary_http_mode_preserves_complete_rows and _proj_cost, so adding a field to the dataclass forces every serializer along the path to carry it or fail.

Done when: adding a field to CostRow and to the REST route, while omitting it from the MCP serializer, fails at least one test. Verify by doing exactly that, not by inspection — the point of this issue is that inspection said the gate existed and experiment said it did not.

Surfaced while verifying #751, which fixed the immediate _HttpDB breakage; this is the recurrence gate that PR could not reasonably be held for.

Dominant language
Python
Stars
122
Forks
35
Avg merge
1d 18h
Merged PRs (30d)
8

Getting set up

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 Metabuilder-Labs/tokenjam

All issues in Metabuilder-Labs/tokenjam

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.