Skip to content

Fix:Prevent TypeError on /config by filtering out non-serializable Th…#37

Open
miguel-data-sc wants to merge 1 commit intoSafeRL-Lab:mainfrom
miguel-data-sc:fix/Prevent-TypeError-on-config-command
Open

Fix:Prevent TypeError on /config by filtering out non-serializable Th…#37
miguel-data-sc wants to merge 1 commit intoSafeRL-Lab:mainfrom
miguel-data-sc:fix/Prevent-TypeError-on-config-command

Conversation

@miguel-data-sc
Copy link
Copy Markdown

Context

Current main is broken (#36).

What this PR does

Prevent TypeError crash on /config command by filtering out non-serializable Thread objects.

Why this branch is based on an older commit (commit: 186df27)

This fix was developed on top of the last known working state.

@chauncygu
Copy link
Copy Markdown
Contributor

Thanks for reporting this issue! The bug is real, json.dumps does crash on the non-serializable _proactive_thread value.

However, there's a bug in this PR: isinstance(v, type(threading.Thread)) evaluates to isinstance(v, type) (since type(threading.Thread) is the metaclass type), which would incorrectly filter out any class objects, not just Thread instances.

I've already fixed this on main with a simpler and more general approach:

display = {k: v for k, v in config.items() if k != "api_key" and not k.startswith("_")}

This filters out all _-prefixed internal runtime keys (_proactive_thread, _pending_image, _session_id, etc.), which are not user-facing config and may contain non-serializable objects. This avoids hardcoding specific key names and prevents future serialization issues.

Will close soon this PR since the fix is already applied. Thanks again for catching it!

@miguel-data-sc
Copy link
Copy Markdown
Author

miguel-data-sc commented Apr 15, 2026

Cool, glad that it's sorted out, I’ve verified the fix in the latest main branch.
Thanks for reviewing the PR and for the explanation !

nekocheik pushed a commit to nekocheik/cheetahclaws-fork that referenced this pull request Apr 19, 2026
Wire silverhawk-mcp TS stdio MCP server (13+ tools) into cheetahclaws fork
via native cc_mcp client config (.mcp.json, project-scope).

Raw JSON-RPC handshake validated against silverhawk-mcp v0.1.0:
- initialize → protocolVersion=2024-11-05, serverInfo=silverhawk-mcp
- tools/list → all 13+ tools returned with schemas
- boot.health.ok + server.connected + clean SIGTERM shutdown rc=0

Known gap flagged in docs-silverhawk/mcp-silverhawk-plug.md: cc_mcp
MCPManager.connect_all hangs on handshake via managed path despite raw
handshake succeeding in 200ms. 75/75 test_mcp.py upstream still pass so
likely client-side race for this server's output timing. Plug config
validated via raw transport proof; cc_mcp debug deferred post-POC.

Container deploy spec for devop-master SafeRL-Lab#37 included.

Local fork commit, not pushed pending GitLab namespace confirm.

refs SafeRL-Lab#34 SafeRL-Lab#37
nekocheik pushed a commit to nekocheik/cheetahclaws-fork that referenced this pull request Apr 19, 2026
…-serve.py + launch runbook

Wire Path B option δ for POC SafeRL-Lab#38: cheetahclaws runs standalone Matrix
agent bypassing chat-server-bin.

Adds:
- CLAUDE.md at fork root: pilot role overlay (Cas A forward-verbatim +
  MXID roster + A2A rules) sourced from DevopMaster agent/roles/prompts/
  pilot.md. Cheetahclaws reads it as system context.
- scripts/silverhawk-matrix-serve.py: standalone launcher binding matrix
  bridge inbound queue → agent.run() → mx_send outbound reply. Bypasses
  chat-server-bin entirely. SIGTERM-safe, accept_all permissions for POC.
- docs-silverhawk/poc-38-launch-spec.md: runbook for devop-master (new
  Matrix token generation via Dendrite login, stop classic supervisor
  units, launch cheetahclaws standalone, smoke probe, observation setup,
  POC run plan, rollback).

Closes wiring gap flagged post-SafeRL-Lab#37 (cheetahclaws installed but not
active runtime). Enables true POC thesis validation.

refs SafeRL-Lab#33 SafeRL-Lab#34 SafeRL-Lab#35 SafeRL-Lab#37 SafeRL-Lab#38
nekocheik pushed a commit to nekocheik/cheetahclaws-fork that referenced this pull request Apr 19, 2026
…Lab#56

Add scripts/silverhawk-launch.sh (bash wrapper):
- Sources /usr/local/bin/glm to export ANTHROPIC_AUTH_TOKEN + BASE_URL
  (z.ai gateway Anthropic-compat for glm-* models)
- Parses /home/ide/.config/matrix/credentials.json for MATRIX_*
- Uses pkill pattern for stop-start swap (supervisorctl broken in
  these containers per preflight audit SafeRL-Lab#56)
- Execs silverhawk-matrix-serve.py in foreground

Update runbook poc-38-launch-spec.md per preflight findings:
- No new Matrix token generation needed (reuse credentials.json +
  stop-start swap frees the @testbot session cleanly)
- pkill stop pattern (supervisord lacks [supervisorctl] section)
- Cred sourcing inline from /usr/local/bin/glm + credentials.json
- Simplified 6-step checklist (fork pull → matrix-nio install →
  creds confirm → stop classic via launcher → launch → smoke)
- Rollback procedure (pkill serve + nohup restart classic)

refs SafeRL-Lab#33 SafeRL-Lab#34 SafeRL-Lab#35 SafeRL-Lab#37 SafeRL-Lab#38 SafeRL-Lab#56
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.

2 participants