Repository navigation
Fix/mcp type mappings - #299
Khush7Chauhan wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Thank you for this follow-up, and for the regression test covering the null template description. The change restores the Posted automatically by Mira, an Accord Project agent. A maintainer will follow up; they make the decisions on this. |
JayDS22
left a comment
There was a problem hiding this comment.
Partially right, but the compiler-error ask from the #282 split is still open.
Correct and justified: description coalescing. The MCP SDK Resource type declares description?: string | undefined; the Postgres column is string | null. The spread of t into the Resource literal creates a real type mismatch on that one field. The new regression test ("does not expose a null template description in listResources") pins the fix. Good.
Not justified by the compiler, as far as I can tell: the other coalesced fields. template, templateHash, state, agreementParties, signatures, historyEntries, attachments, references, metadata are APAP extensions that ride along on ...a; they are not declared on the MCP SDK's Resource interface. If TypeScript was flagging them, I would expect a specific error citing Resource. If it was not, these ?? undefined mappings are defensive but do not fix a real type error. Could you paste the exact tsc --noEmit output that shows which fields failed? That was the specific ask from the #282 split, and it is still what would settle whether the broader coalescing is needed or just noise.
ignoreDeprecations: "6.0" still needs the specific deprecation named. The flag silences a warning rather than fixing a cause. Without naming the deprecation this PR is suppressing, a future compiler upgrade will carry the suppression forward blindly. The commit comment on the tsconfig line (or the PR body) should name the deprecated option and the replacement path.
Suggest: narrow the coalescing to just description for now (unless the compiler output shows otherwise), and document the ignoreDeprecations reason inline. I would approve the narrowed version on sight.
…ppresses The flag was added without saying which deprecation it silences. It suppresses two TypeScript 6.0 deprecations: - TS5107: `moduleResolution: "node"` (node10), replaced by `"node16"` or `"nodenext"` - TS5101: `baseUrl`, replaced by `paths` entries that do not need a base directory Both stop working in TypeScript 7.0, so the suppression is scoped to the 6.x window and should be removed once those options are migrated. No source change is needed for the null-coalescing half of the follow-up: the resource discovery rewrite in accordproject#289 already omits a null template description when it builds the MCP Resource, and mcp.test.ts fixtures a null description to pin it. Signed-off-by: khush chauhan <khushchauhan2006@gmail.com>
57f84fa to
cd7db30
Compare
|
Narrowed to tsconfig-only. The For the record, you were right on the other fields: no compiler error ever cited them — only
One ask: the flag is only valid from TypeScript 6, and the repo pins 5.8.3, so |
|
Keep #299 narrow and defer. Suggest: close #299, reopen the |
|
Understood — I'll close this and keep the ignoreDeprecations + inline-doc hunk for the TypeScript 6 bump PR, without strict: false. Thanks for checking the pinned tsc version and for flagging that the typed-error migration depends on strict-null; I'll leave the compiler settings alone until the bump lands. |
Follow-up to #282
Narrowed per review (#299 (review)).
What changed
server/tsconfig.json:"ignoreDeprecations": "6.0", with an inline commentnaming the two deprecations it suppresses and their replacements.
Why there is no source change
#289 (
f8df897) rewrote resource discovery.listResourcesForDiscovery()already builds the MCP
Resourceexplicitly and omits a null description:server/handlers/mcp.test.tsalready fixturesdescription: nulland assertsthe field is omitted. The
?? undefinedblocks and the regression test fromthe original follow-up were therefore superseded and have been dropped.
Compiler output
Only
descriptionever produced a type error, and only withstrictNullChecksenabled (this tsconfig does not enable it):
There is no corresponding error for
template,templateHash,state,agreementParties,signatures,historyEntries,attachments,references, ormetadata— they are not declared on the MCPResourcetype, so the extra coalescing was defensive, not a fix.
Deprecations being suppressed
TS5107"moduleResolution": "node"(node10)"node16"/"nodenext"TS5101"baseUrl"pathsentries with no base directoryBoth stop working in TypeScript 7.0. The suppression is scoped to the 6.x
window and should be removed once those options are migrated.
CI caveat
The repository pins TypeScript 5.8.3, which rejects the value:
The flag is valid from TypeScript 6. Verified clean on 6.0.3 with
"strict": false. Needs a decision: fold the TypeScript 6 bump into this PR,or land the bump separately and rebase this on top of it.