Skip to content

Fixed inspect_request implementation#455

Merged
anutosh491 merged 2 commits intocompiler-research:mainfrom
JohanMabille:inspect
Mar 11, 2026
Merged

Fixed inspect_request implementation#455
anutosh491 merged 2 commits intocompiler-research:mainfrom
JohanMabille:inspect

Conversation

@JohanMabille
Copy link
Collaborator

@JohanMabille JohanMabille commented Mar 11, 2026

Fixes the implementation of inspection.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the C++ kernel’s inspect handling by switching inspect_request_impl to return proper Jupyter inspect_reply JSON (with status: "ok" and found indicating success), and refactors inspection logic to return an inspect URL string that is then formatted into reply data.

Changes:

  • Update inspect_request_impl to use xeus::create_inspect_reply(...) and build the data bundle only when documentation is found.
  • Refactor inspect from “mutate kernel_res JSON” into std::string inspect(...) plus build_inspect_data(...) for formatting.
  • Align tests with the Jupyter inspect protocol expectations (status == "ok" even when found == false) and remove now-obsolete helper tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
test/test_interpreter.cpp Updates inspect/execute tests to match the new inspect reply semantics.
src/xinterpreter.cpp Reworks inspect_request_impl to build and return inspect_reply via xeus helpers.
src/xinspect.hpp Updates internal inspect API to return a string result and expose build_inspect_data.
src/xinspect.cpp Implements refactored inspect + build_inspect_data, and updates introspection preamble to use xeus helper replies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link

codecov-commenter commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 86.53846% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.67%. Comparing base (4d4d2b2) to head (aa65e9b).

Files with missing lines Patch % Lines
src/xinspect.cpp 86.36% 6 Missing ⚠️
src/xinterpreter.cpp 87.50% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #455      +/-   ##
==========================================
- Coverage   81.06%   80.67%   -0.39%     
==========================================
  Files          21       21              
  Lines         866      859       -7     
  Branches       78       78              
==========================================
- Hits          702      693       -9     
- Misses        164      166       +2     
Files with missing lines Coverage Δ
src/xinspect.hpp 100.00% <ø> (ø)
src/xinterpreter.cpp 89.02% <87.50%> (-0.49%) ⬇️
src/xinspect.cpp 92.72% <86.36%> (-1.40%) ⬇️
Files with missing lines Coverage Δ
src/xinspect.hpp 100.00% <ø> (ø)
src/xinterpreter.cpp 89.02% <87.50%> (-0.49%) ⬇️
src/xinspect.cpp 92.72% <86.36%> (-1.40%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Copy link
Collaborator

@anutosh491 anutosh491 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks !

@anutosh491
Copy link
Collaborator

Merging !

@anutosh491 anutosh491 merged commit ff0a307 into compiler-research:main Mar 11, 2026
18 checks passed
@JohanMabille JohanMabille deleted the inspect branch March 11, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants