Introduction¶
The core idea of DeepSeek Harness (DSH) is “everything is a plugin.” When developing or using DSH for automated tasks, scripts often need to call external APIs. For homework platforms such as Touge (EduCoder), typical automation solutions require browser automation, screenshot recognition, or OCR, which increases complexity and consumes resources.
dsh-educoder is a DSH plugin developed directly against the JSON APIs of the EduCoder platform. It scans all unfinished homework for an account and resolves them in one pass, achieving “zero-token” scanning and “zero-token” multiple-choice questions. This plugin does not rely on a browser; it only uses publicly available platform APIs and is suitable for scenarios where EduCoder homework needs to be handled automatically within DSH workflows.
Plugin Overview¶
- Name:
dsh-educoder - Owner: isheng-eqi
- Category: Workflow
- License: MIT
Core Value:
1. Full Scan: One click scans all incomplete homework under the account.
2. Low-token Design: Scanning uses zero tokens; multiple-choice questions use zero tokens (the answer key is returned by the platform response); only coding questions call the model.
3. Real Submission: Automatically performs real submission and evaluation, consuming evaluation attempts.
Installation and Enablement¶
The plugin package name is dsh-educoder, and the bundle row id is educoder. It is recommended to use the prebuilt npm package to avoid local build authorization issues.
In DSH plugin management, execute one of the following commands:
# npm 安装(推荐)
# target: dsh-educoder
# 从 GitHub 安装
# target: github:isheng-eqi/dsh-educoder
After installation, an educoder configuration item appears in the ~/.dsh/profiles/<profile>/cordis.patch.yml file. Configuration supports hot application, so DSH does not need to be restarted after changes.
Configuration Options¶
Fill in the following parameters in the DSH plugin settings interface or configuration file:
| Key | Default | Description |
|---|---|---|
login / password |
Empty | Touge (EduCoder) account. The session cookie is reused after the first login, and the password is not directly displayed in the conversation. |
sessionFile |
~/.educoder/session.json |
Session cache path, shared with the educoder-lab CLI. |
provider / model |
Empty | Model used for answer generation; if left blank, the current session model is used. |
maxAttempts |
3 | Maximum retry attempts per coding question. |
maxTokens |
8000 | Maximum tokens for a single generation. |
gradeTimeoutSec |
180 | Maximum wait time for a single evaluation. |
pollIntervalSec |
3 | Interval for polling evaluation results. |
challengeLimit |
0 | Number of failed levels to handle per homework; 0 means finish all failed levels in one pass. |
homeworkLimit |
0 | Maximum number of homework items to process in a single full scan; 0 means unlimited. |
toolTimeoutMinutes |
45 | Overall tool timeout. |
Typical Usage¶
1. Account Check and Course List¶
Before submitting any homework, check the account connection status. Listing courses alone does not prove that the session is valid (/courses.json does not require login); level data must be read once.
educoder_account url: <你的作业链接>
2. Scan Incomplete Homework¶
Zero-token scan all homework for the account (or a specified course). This only reads data and does not submit.
educoder_sweep mode=scan
3. Resolve All Homework¶
Execute the actual resolution process. Multiple-choice questions automatically obtain the answer key from the platform response, no model is needed; coding questions call the model to generate and submit evaluation.
educoder_sweep mode=solve
4. Process a Single Homework¶
Check or resolve a specific homework item.
# 巡检模式,只读不提交
educoder_homework url: <作业链接> mode=survey
# 解决模式,默认
educoder_homework url: <作业链接> mode=solve
Key Implementation Points¶
The plugin is implemented based on measured use of the EduCoder platform APIs. The core logic is as follows:
- Signature Mechanism: Each request carries
X-EDU-Type/Timestamp/Signature. The signature algorithm ismd5(base64("method=<M>&ak=<AK>&sk=<SK>&time=<epoch-ms>")).AK/SKare public constants in the platform front-end bundle. - Level Traversal: The platform has no “get level N” API. The plugin first backs up to the starting point of the first failed level via
prev_game, then traverses forward. After passing one level, that level must be read again, becausenext_gameis null before passage. - Single Evaluation: Multiple files in a level are evaluated as a whole. Set
evaluate: 0during upload, then triggergame_build.jsononce after all files are uploaded, avoiding multiple triggers that cause half-finished evaluations to waste quota. - Evaluation Judgment: Wait for
game.evaluate_countto actually increase, confirming that a new evaluation has started; then wait for two consecutive polling results to be consistent.game.status == 2is directly judged as passed. - Placeholder Handling: The platform’s fill-in-the-blank placeholders are
—(U+2014), which are not valid code. If the answer retains this character, the plugin retries locally directly, without wasting evaluation attempts. - Failure Feedback: Instead of truncating both output sides, it locates the first difference (line/column + context), allowing the model to correct quickly.
- Session Expiration Detection: When the platform returns 401, the HTTP status code is 200. If the plugin detects
{"status":401}in the body, it automatically triggers re-login, executed before any write operation. - Session Validation:
/courses.jsonreturns data even without login, so it cannot be used to validate credentials. The plugin places session validation on the first level data read.
Applicable Scenarios and Notes¶
- Real Submission:
mode=solvetruly submits to the platform and consumes evaluation attempts. If unsure, usemode=surveyfirst. - Account Security: It operates on the account entered in the configuration; do not point it to other people’s accounts.
- Permissions and Cache: The session cache file is written with
0600permissions and is readable only locally. - Public Keys:
AK/SKare platform public constants; the plugin does not involve third-party keys. - Unofficial Client: This is an unofficial automation client. Use it within the scope permitted by the Touge platform terms.
- Code Modification: If you modify
index.jsorlib/*.js, DSH must be restarted (dsh web). DSH caches modules by package name and does not reload packages with the same name within the same process.
Summary¶
dsh-educoder integrates EduCoder homework automation into the DSH ecosystem through precise API operations and low-token strategy. It is suitable for developers who need to process large volumes of homework automatically within DSH workflows and who prioritize cost control and operational efficiency.
- Documentation: dsh-educoder
- Source Code: github.com/isheng-eqi/dsh-educoder