Skip to content

Instantly share code, notes, and snippets.

View aisensiy's full-sized avatar

aisensiy aisensiy

View GitHub Profile
@aisensiy
aisensiy / README.md
Created November 8, 2026 08:07
Minimal reproduction: DurableAgent.observe() never terminates when the observed run suspends (@mastra/core 1.83.0-alpha.1)

Minimal reproduction: DurableAgent.observe() never terminates when the observed run suspends

Demonstrates that agent.observe(runId, {}) delivers the tool-call-suspended chunk and then stays open forever on @mastra/core 1.83.0-alpha.1, while the runner's own stream() with closeOnSuspend: true closes cleanly. Also demonstrates that the only built-in way to terminate the observer, idleTimeoutMs, ends the stream with an error chunk instead of a clean close.

Expected vs actual

  • Expected: an opt-in (e.g. observe(runId, { closeOnSuspend: true })) closes the observer
@aisensiy
aisensiy / cjk-word-diff.patch
Created October 31, 2026 15:25
DSH word-level diff marks for CJK prose + wrap-by-default diff views (applies on master ce7073d512, git apply -p1)
diff --git a/packages/client/ui-deliverables/package.json b/packages/client/ui-deliverables/package.json
index 4172b1f4c2..454ec1f856 100644
--- a/packages/client/ui-deliverables/package.json
+++ b/packages/client/ui-deliverables/package.json
@@ -91,6 +91,7 @@
"lib/types/**/*.d.ts"
],
"dependencies": {
- "@deepseek-ai/dsh-typert-protocol": "workspace:*"
+ "@deepseek-ai/dsh-typert-protocol": "workspace:*",
@aisensiy
aisensiy / run.sh
Created July 30, 2020 08:11
访问集群内的 mysql
#!/bin/bash
# kubectx -> dev env
kubectx
# kubens -> infra
kubens
# list service use openbayes-mysql-master
kubectl get svc
@aisensiy
aisensiy / run.sh
Created June 30, 2020 15:39 — forked from dehamzah/run.sh
Create read only mysql database user
# Login
$ mysql -u root -p
# Check privileges
$ SHOW GRANTS FOR 'read-only_user_name'@'%';
# Remove the privileges if any
$ REVOKE ALL PRIVILEGES ON database_name.* FROM 'read-only_user_name'@'%';
@aisensiy
aisensiy / main.go
Created January 17, 2019 14:42
Jwt in Golang
package main
import (
"fmt"
jwt "github.com/dgrijalva/jwt-go"
)
func main() {
// sample token string taken from the New example
DEBU[0000] events| BuildStarted
DEBU[0000] options| AWSOptions *core.AWSOptions
DEBU[0000] options| AWSAccessKeyID string =
DEBU[0000] options| AWSRegion string = us-east-1
DEBU[0000] options| AWSSecretAccessKey string =
DEBU[0000] options| S3Bucket string = wercker-development
DEBU[0000] options| S3PartSize int64 = 104857600
DEBU[0000] options| ApplicationID string = getting-started-nodejs
DEBU[0000] options| ApplicationName string = getting-started-nodejs
DEBU[0000] options| ApplicationOwnerName string = wercker
@aisensiy
aisensiy / docker-info
Created June 13, 2016 14:17
docker-info
Containers: 4
Images: 28
Server Version: 1.11.2
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 109
Dirperm1 Supported: true
Logging Driver: json-file
Kernel Version: 4.2.0-18-generic
@aisensiy
aisensiy / purge.sh
Last active March 16, 2016 10:19 — forked from adrienbrault/purge.sh
Script to reduce VM size before packaging for vagrant
#!/bin/bash
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5
# save this file to ~/.gitconfig
[core]
editor = vim
[user]
name = YOUR_NAME
email = YOUR_EMAIL
[alias] # here is some alias to make your git more powerful
st = status
di = diff
co = checkout
#!/usr/bin/python
# -*- encoding: UTF-8 -*-
import codecs
import sys
from math import log
from collections import defaultdict
class Trie (object):
class TrieNode: