Skip to content

Add Qwen Code external agent#34

Open
suhaanthayyil wants to merge 1 commit into
entireio:mainfrom
suhaanthayyil:suhaan/qwen-code-agent
Open

Add Qwen Code external agent#34
suhaanthayyil wants to merge 1 commit into
entireio:mainfrom
suhaanthayyil:suhaan/qwen-code-agent

Conversation

@suhaanthayyil

@suhaanthayyil suhaanthayyil commented May 21, 2026

Copy link
Copy Markdown

Summary

Adds official Qwen Code support via a native Go external-agent binary, entire-agent-qwen.

Closes #20.

What changed

  • Adds agents/entire-agent-qwen with Qwen Code protocol support.
  • Installs Qwen command hooks in .qwen/settings.json for lifecycle, tool, compaction, notification, permission, and subagent events.
  • Maps Qwen lifecycle hooks into Entire normalized events and records tool/subagent/permission metadata into an Entire-owned sidecar transcript.
  • Preserves existing and future Qwen hook settings during install/uninstall, including HTTP hooks, env, statusMessage, allowedEnvVars, custom matcher fields, and unknown keys.
  • Supports observed Qwen payload aliases: prompt/user_prompt, tool_input/inputs/input, and tool_response/response/tool_result.
  • Handles Qwen Code's empty continuation UserPromptSubmit events without resetting Entire's pre-prompt checkpoint snapshot.
  • Extracts modified files from common file path keys, nested edit payloads, and shell write commands.
  • Stores stable sidecar transcripts in a repo-scoped OS temp directory and writes .entire/tmp/<session_id>.json markers for Entire session discovery.
  • Adds transcript analysis and compact transcript support.
  • Adds gated Qwen lifecycle e2e adapter behind QWEN_E2E=1 E2E_AGENT=qwen.
  • Updates docs and available-agent tables.

Validation

  • mise run build agents/entire-agent-qwen
  • mise run test agents/entire-agent-qwen
  • mise exec -- external-agents-tests verify agents/entire-agent-qwen/entire-agent-qwen
  • mise exec -- golangci-lint run in agents/entire-agent-qwen
  • Real local Qwen Code e2e with Qwen Code 0.16.1 + Ollama qwen3:8b through the OpenAI-compatible endpoint: Qwen emitted structured write_file tool calls, Qwen Code created hello.txt and qwen_agentic_report.md, Entire hooks fired, commit condensed metadata, and entire checkpoint list --session 5444285a-6225-4e79-8403-99bb7784b3d3 reported checkpoints 1.

Notes

  • This integration targets the Qwen Code CLI (qwen), not the Qwen-Agent Python framework and not Claude Code.
  • Local-model success depends on Qwen Code receiving executable structured tool calls from the selected model/backend. The real validation above used Ollama qwen3:8b because it executed Qwen Code tools successfully on this machine.

@suhaanthayyil suhaanthayyil force-pushed the suhaan/qwen-code-agent branch from 06a132b to 5d76cae Compare May 21, 2026 01:49
@suhaanthayyil suhaanthayyil mentioned this pull request May 21, 2026
@suhaanthayyil suhaanthayyil force-pushed the suhaan/qwen-code-agent branch from 5d76cae to 8e8c974 Compare May 22, 2026 20:56
@suhaanthayyil

Copy link
Copy Markdown
Author

Validation update after real local Qwen test:

  • Fixed an observed real-run issue where Qwen Code emits a second empty UserPromptSubmit after tool execution. The adapter now records that payload in the sidecar but does not turn it into a new TurnStart, so Entire's pre-prompt file snapshot is not reset after files are already written.
  • Real end-to-end test passed with Qwen Code 0.16.1 + local Ollama qwen3:8b through the OpenAI-compatible endpoint. Qwen emitted structured write_file tool calls, Qwen Code created hello.txt and qwen_agentic_report.md, Entire hooks fired, git commit condensed metadata, and entire checkpoint list showed checkpoints 1 for session 5444285a-6225-4e79-8403-99bb7784b3d3.
  • Validation commands passed: mise run build agents/entire-agent-qwen, mise run test agents/entire-agent-qwen, mise exec -- external-agents-tests verify agents/entire-agent-qwen/entire-agent-qwen, and golangci-lint run for the Qwen agent.

One local-only note: repo-level mise run test:ci failed because my working tree has unrelated untracked LangGraph/CrewAI agent directories from a separate branch; the Qwen agent itself is clean and those directories are not part of this PR.

@suhaanthayyil suhaanthayyil force-pushed the suhaan/qwen-code-agent branch from fd31114 to 5a281ba Compare May 27, 2026 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

QWen acccess

1 participant