R-Think

Troubleshooting

Common issues and their solutions when working with R-Think.

RuleViolation Errors

RuleViolation errors occur when input or output fails validation. Check the error message for the specific rule that failed.

rule-violation.ts typescript
// Error: Rule violated: score must be between 0 and 100
try {
  await runtime.execute({ score: 150 });
} catch (error) {
  if (error.code === 'RuleViolation') {
    console.log(error.rule);     // 'bounded'
    console.log(error.field);    // 'score'
    console.log(error.constraint); // '0 <= score <= 100'
    console.log(error.value);    // 150
  }
}

Protocol Timeout

Protocols timeout when steps take longer than the configured timeout. Increase the timeout or optimize the step action.

Solution

Set a timeout on the runtime configuration or individual steps. Use the retry configuration for transient timeouts.

Memory Leaks

Long-running runtimes can accumulate artifacts in memory. Clear artifacts periodically or use external storage.

Tip

Configure artifact retention policies. Use the Artifact.prune method to remove old artifacts.