Hands-on case studyContent Creation & Writing

Write Tech Blog Posts: a Tokeny case study

Generate well-structured tech blog articles with code highlighting from code examples and key points. Follow the recorded task, execution screenshots, actual files and verification notes.

By the Tokeny team · Windows · Tokeny 1.7.8 · gpt-6-sol

Prepare the inputs

Create a separate workspace in Tokeny, download and unpack the sample inputs, then select a model that supports tools. The sample uses synthetic data or the public sources named in the article.

  • package.json
  • retry.js
Download sample inputs

Send the task to Tokeny

The original task was executed in Chinese. Copying these instructions reproduces the same task; the results below include an English report.

阅读实际代码并运行示例,写一篇讲解带抖动的指数退避的技术博客,解释边界、可复现示例及失败情形。

交付文件:blog.md、example.mjs。
验收要点:
- 运行示例并记录结果
- 解释 8000ms 上限和抖动区间
- 不把重试用在所有错误上
这是使用合成演示输入或指定公开资料的真实操作案例。请先读取工作空间输入,再实际生成文件并自检。所有写入、脚本与临时服务限于当前工作空间;临时服务只监听 127.0.0.1,执行后关闭;不触达外部收件人、不发布、不付款、不更改系统设置,不调用子智能体。需要公开资料时可读取给定 URL。只启用完成任务必需的工具。另写 report.md(中文)和 report.en.md(英文),每份 400–800 字,包含输入、处理步骤、真实结果、检查方式和局限;失败或未验证部分如实记录,不能宣称成功。最终回复用中文列出产物、关键结果与待核实项。

The recorded run used an isolated demonstration workspace. Review the commands and file paths before approving operations in your own workspace.

What actually ran

The task was submitted through the Tokeny input box. An online model read the inputs and executed tools. This run covers the local sample task and its actual files. Results and checks are recorded below.

The actual Tokeny 1.7.8 session and files for Write Tech Blog Posts. Open the image at full size.
The actual Tokeny 1.7.8 session and files for Write Tech Blog Posts. Open the image at full size.

Results and verification

Input

I read the workspace files retry.js, package.json, and ENVIRONMENT.md. The real implementation is delay(attempt, random). It accepts a non-negative integer attempt, computes min(8000, 250*2^attempt), multiplies that value by 0.5 + random()*0.5, and rounds to an integer number of milliseconds. The package is configured as an ES module, and the environment identifies Node as the intended runtime.

Processing

First, I invoked the existing function directly with deterministic random values of 0, a value close to 1, and 1 to inspect the jitter bounds and the 8000 ms cap. I also passed a negative integer, a fractional number, a numeric string, and NaN to observe invalid-input behavior. I then created example.mjs, imported the real implementation, and supplied a fixed random sequence. The example prints a complete delay table, a jitter sample, a simulated operation that receives two HTTP 503 responses before success, and a simulated HTTP 400 response that is not retried. No network request or temporary service was used.

Actual Results

The runtime was Node v22.23.4. node example.mjs completed successfully. The output reported 125–250 ms for attempt 0, 250–500 ms for attempt 1, and 4000–8000 ms for attempt 5. Attempts 6 and 7 stayed at 4000–8000 ms, confirming that the pre-jitter value is capped at 8000 ms. Four deterministic samples at attempt 3 were 1000, 1250, 1500, and 2000 ms. The retry simulation waited 188 ms and 375 ms after status 503, then succeeded on attempt 2 with status 200. Status 400 produced retry=false. The invalid values -1, 1.5, and the string 1 each produced RangeError:attempt.

Checks

I reran node example.mjs and compared the stable output with the formula in retry.js. I checked the lower and upper jitter cases, the capped attempts, the success path, the non-retryable path, and invalid input. I also checked that all four requested files exist and that the example imports the workspace implementation rather than duplicating it.

Limitations

This is a local demonstration with synthetic inputs. It does not validate network latency, a server's Retry-After behavior, or synchronization among many real clients. Fixed random values demonstrate boundaries but do not estimate a probability distribution. The status classification is intentionally small; production code still needs an API-specific policy for timeouts, 429, 5xx, idempotent writes, maximum attempts, a total deadline, cancellation, and observability. None of those concerns should be inferred from this delay function alone. The example also avoids sleeping, so its timing output is a calculated delay rather than elapsed wall-clock time. This makes the run fast and repeatable, but it leaves scheduler behavior, timer resolution, and cancellation timing outside the tested scope.

Download and inspect the outputs

The archive contains the files created during this run. Use these checks when adapting the example to your own data.

  • Reconcile the reported results against the downloadable sample inputs.
  • Open the generated files and check the contents relevant to your task.
  • Review the limitations and any unverified steps in the report.
blog.md · 3 KBexample.mjs · 2 KBreport.md · 2 KBreport.en.md · 3 KB
Download actual outputs

More in this category