Skip to content

Add IPython 9 compatibility#75

Merged
emeryberger merged 7 commits intomainfrom
fix-ipython9-compat
Jan 29, 2026
Merged

Add IPython 9 compatibility#75
emeryberger merged 7 commits intomainfrom
fix-ipython9-compat

Conversation

@emeryberger
Copy link
Member

@emeryberger emeryberger commented Jan 27, 2026

Summary

Fixes #62 - ChatDBG breaks with latest IPython

This PR adds support for IPython 9.x by:

  • Using IPython 9's self.theme.format() API with Token types (from pygments) for proper colored output
  • Removing the context= parameter from print_stack_entry() calls (removed in IPython 9)
  • Requiring IPython >=9.0.0 (dropped IPython 8 support as per review feedback)
  • Requiring Python >=3.11 (IPython 9 requirement)

Test plan

  • Test with IPython 9.x - chatdbg -c continue should work, why command should return correct diagnosis
  • Colors should be preserved in stack trace output (using theme-based formatting)

🤖 Generated with Claude Code

IPython 9 changed its color and debugger APIs:
- color_scheme_table.active_colors was removed (now uses themes)
- print_stack_entry() no longer accepts context= parameter

Add _NoColors fallback class and _get_colors() helper method to handle
the color API change gracefully. Wrap print_stack_entry() call in
try/except to handle the removed parameter.

Also relax IPython version constraint from ==8.18.1 to >=8.18.1,<10
to allow users to use IPython 9.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@nicovank
Copy link
Collaborator

Like I said in the other PR, I don't think there's any reason to keep support for IPython 8, so this should just be simplified for IPython 9+ only in my opinion.

@nicovank
Copy link
Collaborator

Also, I think this PR fully disables colors in IPython 9+ -- which is not what we want (_NoColors). Instead, we want to keep colors in IPython 9+ (and forget about <8, we don't need to provide support for that).

emeryberger and others added 4 commits January 27, 2026 19:15
Address PR review comments:
- Drop IPython 8 support, require IPython >=9.0.0
- Remove _NoColors fallback that was disabling colors
- Use IPython 9's theme API with Token types for proper coloring

Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
IPython 9 requires Python 3.11+, so update:
- pyproject.toml: requires-python = ">=3.11"
- CI workflows: remove Python 3.9 and 3.10 from test matrix

Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
Copy link
Contributor

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 adds IPython 9 compatibility to ChatDBG by updating the color formatting API calls to use IPython 9's new theming system, which resolves the AttributeError with color_scheme_table that was breaking ChatDBG with IPython 9.x.

Changes:

  • Replaced color_scheme_table.active_colors with self.theme.format() API using pygments Token types
  • Removed the deprecated context= parameter from print_stack_entry() calls
  • Updated minimum IPython requirement from 8.18.1 to >=9.0.0 and minimum Python requirement from 3.9 to 3.11

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/chatdbg/chatdbg_pdb.py Updated color formatting to use IPython 9's theme.format() API with pygments Token types and removed context parameter from print_stack_entry()
pyproject.toml Updated IPython requirement to >=9.0.0 and Python requirement to >=3.11 to align with IPython 9's requirements
.github/workflows/sanity.yml Removed Python 3.9 and 3.10 from test matrix to align with new minimum Python version
.github/workflows/code-quality.yml Removed Python 3.9 and 3.10 from test matrix to align with new minimum Python version

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@nicovank nicovank left a comment

Choose a reason for hiding this comment

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

Tested, seems to work 👍

Co-authored-by: Emery Berger <emeryberger@users.noreply.github.com>
@emeryberger
Copy link
Member Author

@claude Fix this CI failure

Error: Prepare step failed with error: Workflow initiated by non-human actor: claude (type: Bot). Add bot to allowed_bots list or use '*' to allow all bots.

@claude
Copy link

claude bot commented Jan 29, 2026

Claude finished @emeryberger's task in 1m 34s —— View job


CI Failure Analysis Complete

  • Analyze the CI failure
  • Identify the workflow configuration issue
  • Provide solution

The Problem

The failing workflow is the "Claude Code Review" action, which is blocking because it was triggered by a bot (claude[bot]) rather than a human user. The error occurs in the prepare step:

Error: Workflow initiated by non-human actor: claude (type: Bot). 
Add bot to allowed_bots list or use '*' to allow all bots.

Why I Can't Fix This

I cannot modify this configuration because:

  1. The workflow isn't in the repository - I checked all files in .github/workflows/ and the Claude Code Action workflow is not there. It's configured through the GitHub App installation or repository settings.

  2. GitHub App permissions - I don't have permissions to modify workflow files in .github/workflows/ for security reasons.

How to Fix It

The Claude Code Action needs to be configured to allow bot actors. You'll need to add the allowed_bots parameter to wherever you have the action configured.

If you're using the action in a workflow file that's not visible to me (possibly in a default branch or repository settings), add:

- uses: anthropics/claude-code-action@v1
  with:
    allowed_bots: '*'  # Allow all bots
    # ... other configuration

Or for more security, allow only the claude bot:

allowed_bots: 'claude[bot]'

Alternatively, if the Claude Code Action is configured through repository settings or the GitHub App installation settings, you may need to update it through the GitHub UI.

Note

The other CI workflows (Sanity and Code quality) are passing successfully - this issue is specific to the Claude Code Review action being triggered by bot commits (like my previous commit that moved the pygments import to the top of the file).

@emeryberger emeryberger merged commit 9badd32 into main Jan 29, 2026
17 of 19 checks passed
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.

ChatDBG breaks with latest IPython

3 participants